Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Adding a Large Number of Rows to TGrid.
Wed, Jul 31 2013 6:45 PMPermanent Link

Steve Gill

Avatar

Hi Tim,

I have been playing with adding a lot of data to a TGrid (over 1000 records) and found it was taking a while.  So I split the code up to see where the delay was.  I used a loop to add 1000 rows using AppendRow and it took 59 seconds.  I then added data to these rows and it took about 5 seconds.

So the delay is in appending the rows. Is there a fast way to add a bunch of rows to TGrid?  

It would be nice to have a BeginUpdate and EndUpdate so the grid doesn't display the rows until they have finished being added, but I don't know whether or not that is possible.

Yes, 1000 rows is a lot of rows, and yes, I could filter the data first so that only a portion of it is loaded into the grid. I just want to see what is possible before things become unwieldy.

Thanks,

Steve
Wed, Jul 31 2013 8:04 PMPermanent Link

Rick

On 01/08/13 08:45, Steve Gill wrote:
>
> So the delay is in appending the rows. Is there a fast way to add a bunch of rows to TGrid?
>
>
Hi Steve.

I also would like TGrid performance improved and asked Tim about it back
in May. Tim's response was that an upcoming update will add
virtualization support to the grid which should do the job.

The thread is here:

http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&msg=2699

--
Rick
Wed, Jul 31 2013 10:26 PMPermanent Link

Steve Gill

Avatar

Rick wrote:

<< I also would like TGrid performance improved and asked Tim about it back
in May. Tim's response was that an upcoming update will add
virtualization support to the grid which should do the job.

The thread is here:

http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&msg=2699  >>

Thanks Rick. Hopefully it's not too far off.

-Steve
Thu, Aug 1 2013 9:09 AMPermanent Link

Matthew Jones

Not knowing anything about this, I imagine that the cost is in setting up all the
browser data, not the displayed data. Thus a row will always be costly. The virtual
grid, if it re-uses visual elements, would of course improve this.

/Matthew Jones/
Tue, Aug 6 2013 12:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< So the delay is in appending the rows. Is there a fast way to add a bunch
of rows to TGrid? >>

Not anything that's exposed.  I'll have to see about adding the ability to
set the row count directly.

<< It would be nice to have a BeginUpdate and EndUpdate so the grid doesn't
display the rows until they have finished being added, but I don't know
whether or not that is possible. >>

Yes, that's how the framework does it now when it is data-bound.

<< Yes, 1000 rows is a lot of rows, and yes, I could filter the data first
so that only a portion of it is loaded into the grid. I just want to see
what is possible before things become unwieldy. >>

Actually, 1000 rows isn't a lot for data, but it is for HTML elements in the
browser, and that's where the major performance issues are, especially with
IE.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Aug 6 2013 5:50 PMPermanent Link

Steve Gill

Avatar

Hi Tim,

<< Actually, 1000 rows isn't a lot for data, but it is for HTML elements in the
browser, and that's where the major performance issues are, especially with
IE. >>

Yeah that's what I meant. Smile I am rewriting an existing PHP app with EWB.  The previous app generated the HTML and that also took a while with that number of records, although only about half the time of EWB because it was just an HTML table, not a grid.  

In the meantime, I'm using a TComboBox to filter the grid by the first letter of one of the fields (Company Name), eg. A, B, C, etc. so it's quite fast at the moment.

-Steve
Image