If you have a grid which have bunch of groups, You might want to collapse the grid to root level at the start of the program or expand all the groups. You can achieve this by using the FlexGrid method call ‘CollapseGroupsToLevel(int groupLevel)’.
Whenever you need to work on collapsing to a specific level from external trigger, I would recommend to identify the collection depth before hand so that you know what is deepest groups you have. So if you requirement to show the grid collapsed on start up, then you call
By default, if you do not collapse to a specific level then grid by default will expand to all groups.
If you want to expand the group to say a specific level then you can do it in the XAML code behind as
grid.CollapseGroupsToLevel(expandLevel); //where expandLevel is set to which ever group level user want to expand to.