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

When to set column headers

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?

4 Replies

AD Administrator Syncfusion Team March 28, 2005 07:21 PM UTC

Sorry, I meant QueryRowCount in the one place where I have "QueryColCount".

AD Administrator Syncfusion Team March 28, 2005 08:49 PM UTC

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).

AD Administrator Syncfusion Team March 28, 2005 09:57 PM UTC

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? Pete

AD Administrator Syncfusion Team March 28, 2005 11:42 PM UTC

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.

Live Chat Icon For mobile
Up arrow icon