How to collapse/expand groups in code

4 posts, 0 answers
  1. Konrad Sikorski
    Konrad Sikorski avatar
    23 posts
    Member since:
    Jul 2010

    Posted 13 Jun 2012 Link to this post

    Hi,

    I have application which contains only RadGridView. Items in this grid are grouped by one of entity property. I would like to remember which group is collapsed and when application will be run again, automatically collapse these rows. In other words I want to remember last application state.

    Thank you for any suggestions.

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Jun 2012 Link to this post

    Hello,

     You could use the ExpandGroup method of the RadGridView to expand the saved group.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Konrad Sikorski
    Konrad Sikorski avatar
    23 posts
    Member since:
    Jul 2010

    Posted 07 Sep 2012 Link to this post

    To use ExpandGroup I need to check which group is Expanded. I can use gridControl.Items.Groups but this objects don't have property IsExpanded. How can I do that?
  5. Einar
    Einar avatar
    19 posts
    Member since:
    Jul 2014

    Posted 24 Aug 2015 in reply to Konrad Sikorski Link to this post

    Konrad Sikorski said:To use ExpandGroup I need to check which group is Expanded. I can use gridControl.Items.Groups but this objects don't have property IsExpanded. How can I do that?

    Items.Groups[index] returns object, so you need to cast it to IGroup.

     If you wanted to expand a group you'd do:

    grid.ExpandGroup((IGroup)grid.Items.Groups[0]);​
    grid.ExpandGroup((IGroup)grid.Items.Groups[0]);​

Back to Top