I have a virtual grid that in addition to getting its data from an outside source, also gets the number of column headers to display from the outside.
Basically, what I need to do is, before the grid starts calling QueryCellInfo, I need to set the number of column headers. When would be a good time to do this? Could I do it in the QueryColCount? QueryRowCount is supposed to return the number of rows, obviously, but I would also know at that point, how many column headers I would need.
I''m just concerned that setting the HeaderCount at that point might have unintended consequences. Is there another event that would be better suited for this?
ADAdministrator Syncfusion Team March 28, 2005 02:21 PM
Sorry, I meant QueryRowCount in the one place where I have "QueryColCount".
ADAdministrator Syncfusion Team March 28, 2005 03:49 PM
You can use QueryColCount to dynamically provide the column count just as you use QueryRowCount to provide the row count. Make sure you have call grid.ResetVolatileData after subscribing to the Query events.
Alternatively, you can set grid.ColCount = xxx before you subscribe to the Query events (and calling ResetVolatileData).
ADAdministrator Syncfusion Team March 28, 2005 04:57 PM
Sorry, I guess I wasn''t clear. I guess my real question is, is there any potential for problems if I set grid.Cols.HeaderCount from the QueryRowCount event?
ADAdministrator Syncfusion Team March 28, 2005 06:42 PM
Setting a header count is normally a one-time thing to do. QueryRowCount may be hit on an on going basis. You may want to put a one-time-only check in your QueryRowCount code to prevent the header code from repeatedly being set.