Good day I am using a Kendo Grid on one of my applications. The Grid is defined like below. Editing of data is done via a popup that started from the _EditRoute action. Data for the grid is bound serverside via _SelectRouteData but users can apply their own filter to the Data via the header column since we have .Filterable() enabled on the Grid. Currently the state of that filter is lost when context passes back to the main grid after an update on the the Popup Screen as we call grid.rebind() in Javascript to refresh data in the Grid Post update.
Is there an easy way to persist the state of the ClientSide filter?
I have tried saving and reapplying the filter in Javascript like this
var filter = grid.dataSource.filter();
grid.rebind();
grid.dataSource.filter(filter);
but this still loses the filter after grid.rebind()
Any help would be greatly appreciated.
Best Regard
Wilhelm Erxleben
@(Html.Telerik().Grid(Model) .Name("RouteManagement") .DataKeys(keys => keys.Add(r => r.RouteID)) .ColumnContextMenu() .Columns(columns => { columns.Bound(r => r.RouteID).Title("Route ID").Width(40).Hidden(true).IncludeInContextMenu(false); columns.Command(commands => commands.Custom("editRoute") .Text("Edit Route") .ButtonType(GridButtonType.Image) .DataRouteValues(route => route.Add(r => r.RouteID).RouteKey("routeId")) .Ajax(true) .Action("_EditRoute", "RouteData") ).Width(50).IncludeInContextMenu(false); columns.Bound(r => r.AccountNo).Title("Account No") columns.Bound(r => r.ConsumerNo).Title("Consumer No") columns.Bound(r => r.DivertCodes).Width(105); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_SelectRouteData", "RouteData")) .Sortable() .Selectable() .Filterable() .Resizable(resizing => resizing.Columns(true)) .Scrollable(scroll => scroll.Height("410px")) .ClientEvents(events => events .OnLoad("onLoad").OnDataBinding("BindValues") .OnRowSelect("onRouteRowSelected") .OnRowDataBound("onRouteRowDataBound") .OnComplete("onRouteComplete")) )