diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 787e63c95a..1ee20bb40e 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -893,6 +893,8 @@ begin end; procedure TCustomDBGrid.OnDataSetScrolled(aDataset: TDataSet; Distance: Integer); +var + OldEditorMode: boolean; begin {$ifdef dbgDBGrid} DebugLn(ClassName, ' (',name,')', '.OnDataSetScrolled(',IntToStr(Distance),')'); @@ -902,11 +904,20 @@ begin // todo: Use a fast interface method to scroll a rectangular section of window // if distance=+, Row[Distance] to Row[RowCount-2] UP // if distance=-, Row[FixedRows+1] to Row[RowCount+Distance] DOWN + + OldEditorMode := EditorMode; + if OldEditorMode then + EditorMode := False; + if Distance<>0 then begin Row:= FixedRows + FDataLink.ActiveRecord; Invalidate end else UpdateActive; + + + if OldEditorMode and (dgAlwaysShowEditor in Options) then + EditorMode := True; end; procedure TCustomDBGrid.OnUpdateData(aDataSet: TDataSet); diff --git a/lcl/grids.pas b/lcl/grids.pas index 3294a76abb..f9601d8ffe 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -6691,7 +6691,7 @@ begin end; DefaultDrawCell(aCol,aRow,aRect,aState); end; - inherited DrawCellGrid(aCol,aRow,aRect,aState); + DrawCellGrid(aCol,aRow,aRect,aState); end; procedure TCustomDrawGrid.DrawFocusRect(aCol, aRow: Integer; ARect: TRect);