Telerik Radgrid - Persist Client State On Sort/paging/filter
Solution 1:
Take a look at the HierarchyLoadMode property of the MasterTableView. The demo you reference is using HierarchyLoadMode.ServerOnDemand
which, according to Telerik's documentation, means that ViewState only maintains the state of the visible items. Therefore, when a details grid is collapsed you will lose its state (e.g. a sort order, page number, etc).
There are other modes. You can choose HierarchyLoadMode.ServerBind
which maintains ViewState for all detail tables but requires a PostBack to expand a detail table. The HierarchyLoadMode.Client
renders the MasterTableView and all DetailTables and items are expanded/collapsed on the client - no PostBack required. Either of those modes should also maintain the sort order and other state related to the detail tables.
I hope that helps answer your question.
Solution 2:
I recently got a reply from the Telerik support that their AJAX grid supports client binding out-of-the-box with sorting, paging and filtering with flat structure only (as in this demo).
For your case you may have two options:
- extend the example with grid settings persister - http://demos.telerik.com/aspnet-ajax/grid/examples/programming/savinggridsettingsonperuserbasis/defaultcs.aspx
- implement custom solution to simulate hierarchy with client binding as presented in this blog post.
Post a Comment for "Telerik Radgrid - Persist Client State On Sort/paging/filter"