Serialize / Deserialize Grid

2 posts, 0 answers
  1. Randy
    Randy avatar
    75 posts
    Member since:
    Jul 2009

    Posted 11 Apr 2017 Link to this post

    I am using the Kendo grid in an MVC application. I would like to provide a way for users to save a grid layout (serialize it). Then, later, when a user comes back to the page, I'd like to enable the user to restore the grid layout exactly as they had saved it. I presume I would do this by taking the serialized copy of the grid, feed it to some grid method which would then modify the grid layout to match the serialized copy. Is this possible to do with the Kendo grid?
  2. Preslav
    Admin
    Preslav avatar
    571 posts

    Posted 12 Apr 2017 Link to this post

    Hello Randy,

    This functionality is achievable by using the setOptions and getOptions methods.
    Furthermore, a runnable example is available here:

    http://demos.telerik.com/aspnet-mvc/grid/persist-state

    Additionally, if you are using a toolbar or header templates with razor syntax, they are not going to load as expected due to a known limitation of the setOptions method. A workaround for this behavior is outlined in this example: 

    http://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/state/grid-preserve-server-toolbar-template-after-set-options

    Regards,
    Preslav
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top