mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:28:19 +02:00
LCL, dbgrid: fix exception on adding second record (regression caused by r51914 #5224c3c339), fixes issues #29802, #29813
git-svn-id: trunk@51918 -
This commit is contained in:
parent
f6c0e626c2
commit
712eae76cd
@ -3381,6 +3381,7 @@ end;
|
||||
procedure TCustomDBGrid.UpdateActive;
|
||||
var
|
||||
PrevRow: Integer;
|
||||
NewRow: Integer;
|
||||
begin
|
||||
if (csDestroying in ComponentState) or
|
||||
(FDatalink=nil) or (not FDatalink.Active) or
|
||||
@ -3391,7 +3392,10 @@ begin
|
||||
[ClassName, Name, FDataLink.ActiveRecord, FixedRows, Row]);
|
||||
{$endif}
|
||||
PrevRow := Row;
|
||||
Row:= FixedRows + FDataLink.ActiveRecord;
|
||||
NewRow:= FixedRows + FDataLink.ActiveRecord;
|
||||
if NewRow>RowCount-1 then
|
||||
NewRow := RowCount-1;
|
||||
Row := NewRow;
|
||||
if PrevRow<>Row then
|
||||
InvalidateCell(0, PrevRow);//(InvalidateRow(PrevRow);
|
||||
InvalidateRow(Row);
|
||||
|
Loading…
Reference in New Issue
Block a user