The SEO Paging works great, but after sorting the grid then paging, the sort is not retained.
What is the best way to handle this?
1 Answer, 1 is accepted
0
Georgi Krustev
Telerik team
answered on 22 Dec 2008, 08:38 AM
Hello tom,
The issue that you describe is not a bug, but rather expected behavior, because with SEO paging enabled, when you go to other page, the grid is created from scratch. In other words when you choose some page from the grid pager or open the page with URL, which contains the number of the page you want to open, the grid behaves in the same way.
We suggest you keep the value of SortExpressions property in a Cache or Session variable for example, and to retrieve the value from this variable when the OnInit event is fired. In it you can assign the fetched value to the SortExpressions property of the grid, to avoid explicit rebind to reflect the change.
Here is a code snippet which shows how to get the SortExpressions value:
//OnPreRender event get SortExpression value and save it in Session variable
As you noticed I split the SortingString, because if multi-column sorting is allowed, all sort expressions will be enumerated divided by comma. After that each separate sort expression is added to the SortExpressions collection of the master table.
Kind regards,
Georgi Krustev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.