We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

hide large number of rows, performance

Hello All! I''m facing an issue trying to hide a large number of rows in a gridcontrol (3.3.0.11), I''m talking about at least a 1000 rows. I''m following the beginupdate/endupdate pattern; however, it takes a very long time. I''ve used both hiderows and setrowhidden. Any suggestions or is this an issue? Many thanks GA

10 Replies

AD Administrator Syncfusion Team November 1, 2005 06:55 PM UTC

If you need to hide large numbers of rows, then doing it dynamically at runtime is the more efficient. One way you can do this is to handle the grid.model.QueryRowHeight event. There, if e.index points to a row you want hidden, set e.Size = 0 and e.handled = true.


LK Leow Kah Man July 25, 2006 09:31 AM UTC

Why is HideRows so slow?

The grid turns to blank, in the process.
Long enough to be noticeable.


AD Administrator Syncfusion Team July 25, 2006 10:32 AM UTC

Hi Leow,

The Rows.Hidden is actually a dictionary. When you hide a row, an entry is created in the dictionary, and when you make a row visible, this entry is removed from the dictionary. When you call Hidden.SetRange, the grid will only allocate storage for the entries that you specify. This means that if you have 5,000,000, and hide every other one with this technique, then there will be 2.5M entries. However, in such a situation, you could implement such a grid virtually using QueryRowHeight with no memory allocationn. I guess my commnet was to suggest if you use a virtual grid, special knowledge of what you are trying to hide may allow you to do something more economical than the standard implementation that has to work for any case.

Another consideration for the short term is that grids with a large number of hidden rows can have poor scrolling performannce. If you manage your own dictionary, you can actually avoid this scrolling performance penalty by treating all rows as if they were contiguous no matter where they are in your external data source. This would mean that you would have row map allocated, but it would enhanced scrolling performance for the time being.

Thanks,
Haneef


LK Leow Kah Man July 27, 2006 12:31 AM UTC

If the rowheight is 0, for rowindex 2,3,4.
If I am now at 5, and trying to use the arrow keys to move up to 1, will i have to press 4 times?


LK Leow Kah Man July 27, 2006 05:11 AM UTC

I created a small sample to test and find that it works beautifully.

Thank you.


AD Administrator Syncfusion Team July 27, 2006 05:14 AM UTC

Hi Leow,

You will be able to navigate to the Previous/next row in the grid as usual, even though the rows in between may be hidden. This should be fine.

Thanks,
Rajagopal


BR Bryan Roberts January 8, 2013 09:52 PM UTC

I am having a similar issue, but when I change the height to 0 it actually takes longer then HideRows() with a large number of rows (greater than 30k). Any suggestions?

Thanks in advance,
Bryan


AK Arun Kumar V Syncfusion Team January 9, 2013 05:36 AM UTC

Hi Bryan,

Thanks for your interest in Syncfusion products.

Query:

Performance Issue : HideRows() with a large number of rows.

The problem is that the you may have used the implementation of HiddenRows.SetRanges(). It will visit every row  in the range and set all style property . This will take time for large number of rows.

To improve the performance by using the .RowHeights.SetRange and ResetRanges method.

<code>

grid.RowHeights.SetRange(0, INITIAL_ROW_COUNT,ihidden_row,true);

grid.RowHeights.ResetRange(0, INITIAL_ROW_COUNT);

</code>

Please let me know if you have any other concerns.

Regards,

Arun



BR Bryan Roberts January 9, 2013 06:42 PM UTC

Do you make the reset range right after the SetHeights call? Also what is the third variable being passed in SetHeights()?

-Bryan


AK Arun Kumar V Syncfusion Team January 10, 2013 12:23 PM UTC

Hi Bryan,

Thanks for the update.

Query:

Explanation regarding third variable being passed in SetHeights()?

The third argument variable will get the sizes to be applies to the range. Regarding reset range we have already provided sample in the below forum link. 

It seems you have posted the same query in an another forum and we have updated solution regarding that. http://www.syncfusion.com/support/forums/grid-windows/106437

Please follow up that forum­ (106437) for further updates.

Regards,

Arun.


Loader.
Live Chat Icon For mobile
Up arrow icon