Persist Groups Expanded State on Rebind

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 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

This Code Library is part of the product documentation and subject to the respective product license agreement.