Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
How can I expand the first group by row but not the nested group by row by default?
posted

I am programmatically adding 2 group by rows to my grid (I would prefer to do this in the Designer but understand this is not possible?) using the following:

grid.DisplayLayout.Bands[0].SortedColumns.Add("ColOne", false, true);
grid.DisplayLayout.Bands[0].SortedColumns.Add("ColTwo", false, true);

I would like to have the ColOne group expanded by default, and the ColTwo group collapsed by default.

Nothing I do to programmatically expand/collapse rows has any effect, e.g. grid.ExpandAll(), row.Expanded = true, row.ExpandAll() etc. When I inspect the Rows collection e.g. within InitializeLayout there are no UltraGroupByRows in the collection, only data rows - is this expected? I do see the group by rows on-screen at run-time.

The only thing which has any effect on expanding rows is setting            

ultraGridBand1.Override.GroupByRowInitialExpansionState = Infragistics.Win.UltraWinGrid.GroupByRowInitialExpansionState.Expanded;
           
However, that expands both groups whereas I would only like to expand the parent group.

Am I approaching this in the right way, and if so why can't I expand any rows programmatically? Any help appreciated, thanks.