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,9 +2490,15 @@ begin
end; end;
function TCustomDBGrid.EditorIsReadOnly: boolean; function TCustomDBGrid.EditorIsReadOnly: boolean;
var
AField : TField;
begin begin
Result := inherited EditorIsReadOnly; Result := inherited EditorIsReadOnly;
if not Result then begin if not Result then begin
AField := GetFieldFromGridColumn(Col);
if assigned(AField) then
Result := not AField.CanModify;
if not result then
Result := not FDataLink.Edit; Result := not FDataLink.Edit;
EditingColumn(Col, not Result); EditingColumn(Col, not Result);
end; end;