Persist state of PanelBar

3 posts, 0 answers
  1. Marty
    Marty avatar
    22 posts
    Member since:
    Feb 2008

    Posted 18 Dec 2012 Link to this post

    How do you persist state of panelbar items across postbacks?  I am using MVC4 and Razor... with panelbar in a master page _contentLayout f you will... Not sure how I can save the state of items and expanded state easily, don't see any config methods as there might have been in the past with telerik controls.
    thanks
    Marty
  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 20 Dec 2012 Link to this post

    Hi Marty,

    There is no viewstate in the MVC world, so HTML helpers, Kendo UI widgets and their server wrappers do not have built-in state persistence. If you require such a functionality, you need to implement it with custom code -

    1. Use the PanelBar's client events to store information about the items' state in some hidden fields.
    2. Submit the data to the server via a form or Ajax request.
    3. Handle the submitted data in the controller and use it in the View to determine and set the PanelBar items' state.

    All the best,
    Dimo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Marty
    Marty avatar
    22 posts
    Member since:
    Feb 2008

    Posted 20 Dec 2012 Link to this post

    Thanks Dimo!  That's kinda what I thought but I was wondering if you carried over the persist  cookie from older style controls, using tempdata as cookie.  But thanks!  I think I can follow the examples using events!
    Marty
Back to Top