Hello,
I have the following problem: loading approximately 5,000 rows into the FNCDataGrid is extremely slow the second time around. The first load takes about 8 seconds, while the second load—using the exact same data—takes over a minute. The loading process is already wrapped in BeginUpdate and EndUpdate. I have tried completely clearing the grid, removing all filters, and setting the row count to 0, but unfortunately, none of this has helped. I am using the latest version. What else can I do to speed up the loading process? The grid has about 40 columns, though not all of them are visible.
Thanks.
Steffen
Do you have more details how exactly you load the grid?
I did a quick test here with loading not 5000 but 500000 rows and this loads here in below 1.5sec:
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
t: dword;
begin
t := GetTickCount;
TMSFNCDataGrid1.BeginUpdate;
TMSFNCDataGrid1.RowCount := 500000;
for i := 1 to TMSFNCDataGrid1.RowCount - 1 do
begin
TMSFNCDataGrid1.Cells[1,i] := 'item ' + i.ToString;
end;
TMSFNCDataGrid1.EndUpdate;
t := GetTickCount - t;
Caption := t.ToString;
end;
So, what are you doing different?
Hi,
I’ve found the problem. I don’t really understand why performance drops so drastically, but if I remove the following two lines from the code, it runs incredibly fast:
AdvStatusbar.Panels[1].Progress.Position:=AdvStatusbar.Panels[1].Progress.Position+1;
AdvStatusbar.Repaint;
Any ideas? What am I doing wrong here?
Thanks.
Steffen