Ok, it's not that simple, but in the end I managed to create a sample project; please see the attachment.
And version 5.9.9 behaves the same (just updated).
The issue is somehow connected with hiding a panel component covering the grid in case the grid is empty.
Here is the whole code:
procedure TForm1.Button1Click(Sender: TObject);
var
i : Integer;
begin
Grid.BeginUpdate;
for i := 1 to 10 do begin
Grid.AddRow;
Grid.Cell[0, Grid.LastAddedRow].AsInteger := 0;
Grid.Cell[1, Grid.LastAddedRow].AsString := IntToStr(Grid.RowCount);
Grid.Cell[2, Grid.LastAddedRow].AsString := 'some text';
Application.ProcessMessages;
Sleep(100);
end;
Grid.EndUpdate;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Close;
end;
procedure TForm1.ClearClick(Sender: TObject);
begin
Grid.ClearRows;
end;
procedure TForm1.GridDataChange(Sender: TObject; AChangeType: TDataChange;
const AIndex: Integer);
begin
if AChangeType in [dcAddRow, dcInsertRow, dcDeleteRow, dcClearRows] then
EmptyGridPanel.Visible := Grid.RowCount = 0;
end;