1

Delphi 10.4.2, TTMSFNCGrid ver. 1.0.5.16

I am downloading about 30,000 records from the database into a json object. This takes about 1 minute.

I then try to enter (for a loop) the data into TTMSFNCGrid which has about 30,000 records and 16 columns. The data entry takes 20 minutes ! This is how long it takes to render and populate the grid. How can I speed up this process?

I use something like this

 for _i:= 0 to JSON_ARRAY_DANE.Count-1 do
 begin
     _row:=  JSON_ARRAY_DANE.Items[_i] as TJSONObject;
     _grid.Cells[0,_i+1]:=_row.GetValue('c1').Value;
     _grid.Cells[1,_i+1]:=_row.GetValue('c2').Value;
     _grid.Cells[2,_i+1]:=_row.GetValue('c3').Value;
     .
     .
     _grid.Cells[2,_i+1]:=_row.GetValue('c16').Value;
end
2
  • Your q needs a minimal, reproducible example but in any case what do TMS say? Commented Jul 6, 2021 at 18:52
  • TMS is not saying anything yet. I have only just written to them. But maybe someone here has had a similar problem Commented Jul 6, 2021 at 18:59

1 Answer 1

1

Resolved. Need to add:

_grid.BeginUpdate; _grid.EndUpdate;

 **_grid.BeginUpdate;**
 for _i:= 0 to JSON_ARRAY_DANE.Count-1 do
 begin
     _row:=  JSON_ARRAY_DANE.Items[_i] as TJSONObject;
     _grid.Cells[0,_i+1]:=_row.GetValue('c1').Value;
     _grid.Cells[1,_i+1]:=_row.GetValue('c2').Value;
     _grid.Cells[2,_i+1]:=_row.GetValue('c3').Value;
     .
     .
     _grid.Cells[16,_i+1]:=_row.GetValue('c16').Value;
end;
 **_grid.EndUpdate;**
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.