Hi,
I have a radGrid. The data populated is very expensive to gather, so I have opted to collect only the data shown on the current page of the grid and set the virtual count to a select COUNT(*) ...etc. which works fine when I have the radGrid on a webpage.
In the NeedDatasounrce event, I simply get the radGrid.PageSize & radGrid.CurrentPageIndex and use these to figure out the set to return... this all works ok in a web page.
However, if I use the same grid in a server control (built in CreateChildControls()) the page size is always 10, even when I jump from 10 to 20 to 50, each time in (needdatasource event) code it is 10. Viewstate is enabled for this grid, could it be that the viewstate has not loaded for this grid at this point? If so , any reason why not for server control, but OK on the aspx webpage?...(differences in event orders??)
Is there anything I can do to get this pagesize value at the radGrid_needdatasource event for my server control?
ps - This new page value is available by the time we get to the pre_render event... and the PageSize changed event fires after the needdatasource event, so these eventargs are too late to be used in the datasource.
Thanks in advance
I have a radGrid. The data populated is very expensive to gather, so I have opted to collect only the data shown on the current page of the grid and set the virtual count to a select COUNT(*) ...etc. which works fine when I have the radGrid on a webpage.
In the NeedDatasounrce event, I simply get the radGrid.PageSize & radGrid.CurrentPageIndex and use these to figure out the set to return... this all works ok in a web page.
However, if I use the same grid in a server control (built in CreateChildControls()) the page size is always 10, even when I jump from 10 to 20 to 50, each time in (needdatasource event) code it is 10. Viewstate is enabled for this grid, could it be that the viewstate has not loaded for this grid at this point? If so , any reason why not for server control, but OK on the aspx webpage?...(differences in event orders??)
Is there anything I can do to get this pagesize value at the radGrid_needdatasource event for my server control?
ps - This new page value is available by the time we get to the pre_render event... and the PageSize changed event fires after the needdatasource event, so these eventargs are too late to be used in the datasource.
Thanks in advance