Lazarus
Programming => LCL => Topic started by: airpas on March 24, 2014, 07:25:31 am
-
Hi
how to fill the first column with numbers automatically , starting from 1 to RowCount ?
thanks
-
There's property for this: TStringGrid.Options-> goFixedRowNumbering
-
thanks Blaazn
but seems setting a large number of rows caused a poor performance .
for example 1million rows , slow down the execution time by (in my pc 2 second) and eat 120Mb of memory .
MSEGUI seems much optimized , the same example execute faster and eat only 20Mb
-
err How many rows do you have? 120MB just by enabling one option? Are you sure?
-
err How many rows do you have? 120MB just by enabling one option? Are you sure?
The OP already said "1million rows"
-
err How many rows do you have? 120MB just by enabling one option? Are you sure?
The OP already said "1million rows"
Oops speed reading and meased it sorry.
-
Who wants to display 1 million rows in a standard grid? AFAIR the grid wasn't designed for this and you'd need to have a custom virtual grid that saves/loads data to be displayed on the fly...
-
Who wants to display 1 million rows in a standard grid?
I don't know.
AFAIR the grid wasn't designed for this
RowCount being of type integer implies that you can use any integer value. One million is, relatively speaking, a small number compared to MaxInt (2147483647) :P
and you'd need to have a custom virtual grid that saves/loads data to be displayed on the fly...
I agree.
-
AFAIR the grid wasn't designed for this
RowCount being of type integer implies that you can use any integer value. One million is, relatively speaking, a small number compared to MaxInt (2147483647) :P
Well yes, the OP indicates it does seem to work... for a given definition of "work" i.e. depending on your performance requirements ;)
-
it is just a notice come from a simple test.
there should be a limit of row counts , since 1million caused notable slowdown and as engkin said , RowCount is an integer type so it maybe more than millions .
-
err How many rows do you have? 120MB just by enabling one option? Are you sure?
For visualisation of such huge amound of data you can use TVirtualStringTree. TStringGrid isn't right component to do that.
-
there should be a limit of row counts
Are you sure?
Patches welcome... would be interested to see how you intend to calculate that limit (especially given the speed differences between e.g. aRaspberry Pi versus multiple core desktop machines)... or whether you want to have a constant number.
-
Maybe the KGrid could help you with the goVirtualGrid option.
http://tkweb.eu/en/delphicomp/kgrid.html
You can generate the numbers yourself in the OnDrawCell event and this will be fast even for millions of lines.
TK.