mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 14:27:41 +01:00
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:
parent
9f72e7685a
commit
4a1a208473
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user