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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

hide large number of rows, performance

Thread ID:





36499 Nov 1,2005 04:16 PM UTC Jan 10,2013 12:23 PM UTC WinForms 10
Tags: GridControl
Giancarlo Aguilera
Asked On November 1, 2005 04:16 PM UTC

Hello All! I''m facing an issue trying to hide a large number of rows in a gridcontrol (, 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

Administrator [Syncfusion]
Replied On 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.

Leow Kah Man
Replied On 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.

Administrator [Syncfusion]
Replied On 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.


Leow Kah Man
Replied On 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?

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

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

Thank you.

Administrator [Syncfusion]
Replied On 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.


Bryan Roberts
Replied On 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,

Arun Kumar V [Syncfusion]
Replied On January 9, 2013 05:36 AM UTC

Hi Bryan,

Thanks for your interest in Syncfusion products.


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.


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

grid.RowHeights.ResetRange(0, INITIAL_ROW_COUNT);


Please let me know if you have any other concerns.



Bryan Roberts
Replied On 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()?


Arun Kumar V [Syncfusion]
Replied On January 10, 2013 12:23 PM UTC

Hi Bryan,

Thanks for the update.


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.




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon