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 .
static void CollapseGroups(Group group)
foreach(Group subGroup in group.Groups)
Imported from legacy forums. Posted by André (had 531 views)