LCL, dbgrid, Do not only check if a column is readonly, but also if the underlying field is modifyable, from Joost, issue #13177

git-svn-id: trunk@18720 -
This commit is contained in:
jesus 2009-02-17 03:49:34 +00:00
parent 9f72e7685a
commit 4a1a208473

View File

@ -2490,10 +2490,16 @@ begin
end;
function TCustomDBGrid.EditorIsReadOnly: boolean;
var
AField : TField;
begin
Result := inherited EditorIsReadOnly;
if not Result then begin
Result := not FDataLink.Edit;
AField := GetFieldFromGridColumn(Col);
if assigned(AField) then
Result := not AField.CanModify;
if not result then
Result := not FDataLink.Edit;
EditingColumn(Col, not Result);
end;
end;