dbgrid: fix editor doesnt hide if while editing the last record user press down arrow key (issue #8262)

grid: enable descendant grids to override DrawCellGrid

git-svn-id: trunk@10612 -
This commit is contained in:
jesus 2007-02-08 17:52:10 +00:00
parent f0d0a647d0
commit cca097adbc
2 changed files with 12 additions and 1 deletions

View File

@ -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);

View File

@ -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);