I am saving Grid state as following code does.
//for saving Grid State
function SaveGridSettings() {
var grid = $("#myGrid").data("kendoGrid");
localStorage["GridSettings"] = kendo.stringify(grid.getOptions());
}
//for applying Saved State
function setGridSettings() {
var grid = $("#myGrid").data("kendoGrid");
var options = localStorage["GridSettings"];
if (options) {
grid.setOptions(JSON.parse(options));
}
}
This also saves some extra things like sorting and filtering. Well I am OK with every thing saved but not with filters.Is there any way you know to avoid saving filters because it causes annoying behavior to users as if last search string fetch no record,then in future the user see empty grid and start yelling at us. Moreover, Export to Excel button also gets removed after the settings applied back to the grid.
Here I got the solution for myself by excluding filter object from the Options before saving it.Try this while saving the grid options.
var Options = grid.getOptions();
delete Options.dataSource.filter;
localStorage[name] = kendo.stringify(Options);