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

QueryHideRow never called

Hi, I have a virtual grid, I use GridControl with event handlers for QueryColCount, QueryRowCount, QueryCellInfo, SaveCellInfo and QueryCoveredRange. I need also to implement hiding rows at runtime, so I created event handlers for QueryHideRow and SaveHideRow. But none of both is ever called ! Why ? Do I need to activate it somehow or am I doing something what suppresses the events ? Thanks for help. Regards, Jan

7 Replies

AD Administrator Syncfusion Team July 20, 2003 05:16 PM UTC

If you want to dynamically hide rows, you can handle the QueryRowHeight event setting s.Size = 0 and e.Handled = true for the row you want to hide.

JH Jan Hornych July 21, 2003 06:15 AM UTC

Its very slow, allready with 10 rows by 10 cols. I need to have 10000 rows in my grid, than it's unusable. There must be something redundant repeated many times. Any idea what to optimize ? Regards, Jan

JH Jan Hornych July 21, 2003 06:34 AM UTC

I write now trace info of calling event handlers. The QueryRowHeight is called for all rows from the first to the last, then backwards and again up and down, over and over.

AD Administrator Syncfusion Team July 24, 2003 12:24 PM UTC

It turns out that dynamic hiding of rows in QueryRowHeight breaks scrolling, so you will not be able to do it there. To hide the rows, you will have to explicitly set gridControl1.Rows.Hidden[row] = true; (or something equivalent). So, what are the conditions that determine whether a row should be hidden? Maybe, there will be some event that you can catch to explicitly set the Hidden property when these conditions become true.

JH Jan Hornych August 5, 2003 07:50 AM UTC

Hi Clay, using Rows.Hidden might work OK for scrolling but the overall performance is extremely slow as I have 10000 rows in the grid. I understand the internal algorithms need to query info for every row, hidden or not, to do painting and scrolling properly. Therefore my approach is probably overloading the grid. In this forum, I have found your advice to the question of Sue Harris at 3/31/2003 10:42:20 PM, where you recommend using an ArrayList as a "filter" to the real data, so the grid works over a virtual, smaller data. I'm thinking of using this solution. Does it have any drawbacks ? Will scrolling and painting be ok, as the number of rows reported by QueryRowCount will change often ? Thanks, Jan

AD Administrator Syncfusion Team August 5, 2003 09:12 AM UTC

Given a datasource, and using an arraylist to track exactly the rows you want visible in the grid, and then using this arraylist in QueryCellInfo and QueryRowCount to provide the proper mappings works well. Essentially, the grid thinks it is displaying exactly the arraylist, so scrolling and drawing is not a problem. The drawbacks are general drawbacks associated with any virtual grid. They include added complexity if you want to support sorting or moving rows, etc. You can see a sample of this idea in the VirtTreeGrid Sample. No that sample is probably a little slower than what you would normally see as it is doing dynamic processing to determine what rows are hidden or not by looking at whether a rows parent is visible. If you are just inserting and removing indexes to make rows visible or not, that code should be faster than the VirtTreeGrid code (I think.).

AD Administrator Syncfusion Team June 14, 2004 09:52 AM UTC

> If you want to dynamically hide rows, you can handle the QueryRowHeight event setting s.Size = 0 and e.Handled = true for the row you want to hide. >

Live Chat Icon For mobile
Up arrow icon