I fear this might be a “how long is a piece of string” question, but wondered if anyone has some hard figures or advice.
I have a TStringGrid which might have 3,600 rows, maybe more, we are not sure yet. Since the monitor obviously doesn’t have room for this, only 20 or 30 rows are shown on screen. Unfortunately, those are the first ones written and the user has to scroll down to see the rows as they are added.
It might be more user-friendly to reverse the order of the rows,m with newest first and oldest last. To do that, I would need to do something like this (code may not be exact)
// slightly quicker if there are many rows & no flicker
myStringGrid.Visible := False;
rowCount := myStringGrid.RowCount;
for row := 1 to Pred(rowCount) do
myStringGrid.Rows[row + 1] := myStringGrid.Rows[row];
myStringGrid.RowCount := myStringGrid.RowCount + 1;
// now add new row...
myStringGrid.Cells[1, 0] := <somthing>;
myStringGrid.Cells[1, 1] := <somthing else>;
myStringGrid.Cells[1, 2] := <etc>;
TestRunDataStringGrid.Visible := True;
I am concerned about performance. If no one has any experience, I will code a test & report back.
Just wondered if anyone had experience or an opinion of doing this…
Try this one