From 4a1a208473b0c254ede7f134edf49beb91285118 Mon Sep 17 00:00:00 2001 From: jesus Date: Tue, 17 Feb 2009 03:49:34 +0000 Subject: [PATCH] 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 - --- lcl/dbgrids.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index bade718786..afd3c24cc6 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -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;