Home Forums WinForms controls Xceed Grid for WinForms Programatically close/expand groups? Reply To: Programatically close/expand groups?

User (Old forums)
Member
Post count: 23064

There is a typo in Tommy’s code.  In both the CollapseGroups and ExpandGroups method, the recursive call to the CollapseGroups() is done with the wrong parameter.  It is called with group, but it should be called with subGroup .

 i.e.:

  static void CollapseGroups(Group group)
  {
    foreach(Group subGroup in group.Groups)
    {
      CollapseGroups(subGroup );
    }
    group.Collapse();
  }

Imported from legacy forums. Posted by André (had 531 views)