I simply want to have my groupby headers expanded by default to show all their child rows. How do I do this in XAML? Tried searching for this but cant seem to find it anywhere.
Still seems to be a problem. The event gets fired before the data is loaded asynchronously. So there are no rows when the event is fired.
private void AllergyGrid_GroupByCollectionChanged(object sender, Infragistics.Controls.Grids.GroupByCollectionChangedEventArgs e) { if (e.NewGroupedColumns != null && e.NewGroupedColumns.Count > 0) { foreach (Infragistics.Controls.Grids.Row r in ((Infragistics.Controls.Grids.XamGrid)sender).Rows) { r.IsExpanded = true; } } }
Thanks, that was the next event I was trying.
I'm sorry, i should have provided that code before:
You can use the GroupByCollectionChanged event:
Something like:
private void grid_GroupByCollectionChanged(object sender, GroupByCollectionChangedEventArgs e)
{
if (e.NewGroupedColumns != null && e.NewGroupedColumns.Count > 0)
foreach (Row r in grid.Rows)
r.IsExpanded = true;
}
Hope this helps,
-SteveZ
What is the best way to do this in code? I have tried the following:
private void AllergyGrid_InitializeRow(object sender, Infragistics.Controls.Grids.InitializeRowEventArgs e) { if (e.Row != null) { if (e.Row.RowType == Infragistics.Controls.Grids.RowType.GroupByRow) { e.Row.IsExpanded = true; } } } private void AllergyGrid_Loaded(object sender, RoutedEventArgs e) { foreach (Infragistics.Controls.Grids.Row row in ((Infragistics.Controls.Grids.XamGrid)sender).Rows) { if (row.RowType == Infragistics.Controls.Grids.RowType.GroupByRow) { row.IsExpanded = true; } } }
Neither is working.
Hi,
We currently don't offer that option.
You'd have to do this in the code behind.