Hello,
I have a problem getting my sort operation to work properly. I have set up a grid with viewstate disabled.
The grid is used for viewing only and all row-actions are done clientside, so no need for the grid to remember its data
I use custom paging and sorting and in the NeedDataSource event I supply the grid with data.
The LINQ query in that event also applies sorting. When i have viewstate enabled the SortCommand event is fired before the needdatasource, so i can determine the desired sorting and fetch the data all at once in the NeedDataSource event.
But when i disable the viewstate, the SortCommand event is fired after the NeedDataSource event. So i need to execute the LINQ query twice.
So my question is this
Is there any way to determine on posback/callback if the grid is going to fire the SortCommand? and can i use that info to passthe sorting info to the query in the NeedDataSource event implementation?
Or is there a way to force the SortCommand to be fired before NeedDataSource at all times?
When i try to intercept the NeedDataSource event and execute it after the sortcommand, i get no data.
I use 2009 Q2 for Ajax
Thanks
I have a problem getting my sort operation to work properly. I have set up a grid with viewstate disabled.
The grid is used for viewing only and all row-actions are done clientside, so no need for the grid to remember its data
I use custom paging and sorting and in the NeedDataSource event I supply the grid with data.
The LINQ query in that event also applies sorting. When i have viewstate enabled the SortCommand event is fired before the needdatasource, so i can determine the desired sorting and fetch the data all at once in the NeedDataSource event.
But when i disable the viewstate, the SortCommand event is fired after the NeedDataSource event. So i need to execute the LINQ query twice.
So my question is this
Is there any way to determine on posback/callback if the grid is going to fire the SortCommand? and can i use that info to passthe sorting info to the query in the NeedDataSource event implementation?
Or is there a way to force the SortCommand to be fired before NeedDataSource at all times?
When i try to intercept the NeedDataSource event and execute it after the sortcommand, i get no data.
I use 2009 Q2 for Ajax
Thanks