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.
ADAdministrator Syncfusion Team July 20, 2003 12:16 PM
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.
JHJan HornychJuly 21, 2003 01:15 AM
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 ?
JHJan HornychJuly 21, 2003 01:34 AM
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.
ADAdministrator Syncfusion Team July 24, 2003 07:24 AM
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.
JHJan HornychAugust 5, 2003 02:50 AM
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 ?
ADAdministrator Syncfusion Team August 5, 2003 04:12 AM
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.).
ADAdministrator Syncfusion Team June 14, 2004 04:52 AM
> 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.