[Lazarus] String Grid Component

Torsten Bonde Christiansen tc at epidata.info
Mon Nov 27 17:51:34 CET 2017


On 2017-11-27 16:48, Werner Pamler via Lazarus wrote:
> Am 27.11.2017 um 16:21 schrieb Werner Pamler via Lazarus:
>> (a) What is "fast"? If I populate a standard TStringGrid with 100.000 
>> rows x 100 columns (= 10 millions of cells) it takes about 9 seconds 
>> on my PC - if BeginUpdate/EndUpdate is used. Not too bad in my eyes. 
>> If it's too long you should use a TDrawGrid and paint the cells in 
>> the OnDrawCell event. Since this draws only the visible cells it will 
>> occur within the blink of an eye. Editing a TDrawGrid is a bit more 
>> complicated, though, but doable.
>
> I forgot: Of course, this does not take into account the time it takes 
> to populate the primary storage of the data shown in the DrawGrid. 
> Filling a 2D-array with millions of strings, for example, will take 
> its time too, 6 seconds on my PC for a 100.000 x 100 array. In these 
> tests, the string is assembled as 'R' + IntToStr(rowindex) + 'C' + 
> IntToStr(colIndex).
Yes, sorry for the lack of other factors too - those were just the two 
most needed.


I already have the data at hand in my own object structure so that is no 
problem. By fast i mean less than one second, even on a modern PC. The 
users of our program often have old or very old hardware in which case 
my/your 9 seconds turns to 30 or more seconds.

In reallity all i need is a read-only grid that can display the data in 
string format and range selection so that i can copy/paste the data to 
the clipboard.

 From your reply it seems i am going with TDrawGrid.

Thank you for the help!

Regards,
Torsten.


>
> Look at attached demo.
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20171127/9406344a/attachment.html>


More information about the Lazarus mailing list