maintain state of collapsed rows on grid refresh

4 posts, 0 answers
  1. Chris
    Chris avatar
    1 posts
    Member since:
    Jul 2014

    Posted 11 Jul 2014 Link to this post

    I have a grid with grouping. If you collapse a group and then refresh the grid, all groups return to their default expanded state.

    I'm wondering if there is a way to keep track of which groups are collapsed, so that upon refreshing the grid those specific rows can be collapsed again.

    My initial attempt at this was to select all collapsed rows with jQuery, and then pass that list of jQuery objects into the grid's collapseRow function, like this:

    var rows = $('td[aria-expanded=false]').parents('tr.k-grouping-row');

    That works in that I can expand/collapse only those rows that were collapsed when the rows variable was created, however after refreshing the grid those jQuery objects no longer exist on the page so passing "rows" into the collapseRow function has no effect.

    I know that you can save various states about the grid, such as grouping, sorting and column ordering, but is there currently any way to accomplish this?
  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 15 Jul 2014 Link to this post

    Hello Chris,

    I got a little bit confused, by default the state of the detail rows is collapsed and they expand on demand by the user. If this is the case then here is an example that uses a local array to keep track of the expanded rows and then expand each of them on dataBound, please check it out and let me know if it helps:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Soni
    Soni avatar
    2 posts
    Member since:
    Feb 2016

    Posted 31 Aug 2016 in reply to Kiril Nikolov Link to this post

    Hi Chris,

    Did you find the solution of your problem?

    I also have the same requirement i have to save the collapsed group on grid refresh.

    Can anyone help me on this??

    Problem Statement: I have a kendo grid and i am doing grouping by one column and in that grouped items i have collapsed some groups but on grid refresh it goes off.

    Please help.




  4. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 01 Sep 2016 Link to this post


    Please check the following article and let me know if it helps:

    Kiril Nikolov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top