LCL, dbgrid, call SelectEditor manually in DatasetScrolled in case row index do not change, based on patch by Luca Olivetti, issue #27232

git-svn-id: trunk@47911 -
This commit is contained in:
jesus 2015-02-20 03:22:01 +00:00
parent 72326324bd
commit e80dcc0d2d

View File

@ -936,6 +936,7 @@ procedure TCustomDBGrid.OnDataSetScrolled(aDataSet: TDataSet; Distance: Integer
);
var
OldEditorMode: boolean;
OldRow: Integer;
begin
{$ifdef dbgDBGrid}
DebugLn('%s.OnDataSetScrolled Distance=%d ds.RecordCount=%d',[ClassName, Distance, aDataSet.RecordCount]);
@ -950,7 +951,12 @@ begin
EditorMode := False;
if Distance<>0 then begin
Row:= FixedRows + FDataLink.ActiveRecord;
OldRow := Row;
Row := FixedRows + FDataLink.ActiveRecord;
if OldRow=Row then // if OldRow<>NewRow SelectEditor will be called by MoveExtend
SelectEditor; // if OldRow=NewRow we need to manually call SelectEditor
Invalidate;
end else
UpdateActive;