Persist Groups Expanded State on Rebind

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 24 Mar 2008 Link to this post

    Requirements

    RadControls for ASP .NET AJAX version

    2008.1.415 and later
    .NET version

    2.0 and later
    Visual Studio version

    2005 and later
    Programming language

    C#
    Browser support

    all browsers supported by RadControls for ASP .NET AJAX


     
    PROJECT DESCRIPTION
    When there is a requirement to save the groups' expanded/collapsed state in RadGrid you can follow these steps:
    • Create a hashtable to store each group's expanded state, store it in viewstate or in session
    • Wire GroupsChanging, ItemCommand and DataBound events
    • In GroupsChanging and ItemCommand event update the hashtable according to the action taken (expand, collapse, group, ungroup, sort a group)
    • In DataBound event handler loop through the GridGroupHeaderItems and expand/collapse them according to the state stored in the hashtable.
    You can find attached a sample project that implements the described functionality.
Back to Top