Hello,
How can i grouping datagrid by any column on the loading page (a default group by) ?
I prefer to parameter that on xaml code but if you have a solution in code behind it's ok for me too.
Thanks,
Regards.
Cyril Avonde.
Hi,
To group the grid by a given column you can set the IsGroupBy property of the column to True:
... <ig:XamGrid x:Name="XGrid" ItemsSource="{Binding Data}"> <ig:XamGrid.Columns> <ig:TextColumn Key="MyColumn1Key" IsGroupBy="True" /> <ig:TextColumn Key="MyColumn2Key" /> </ig:XamGrid.Columns> ...
Regards,
You could do in the code behind file like this.
Column col1 = this.xamGridPrgProposal.Columns.DataColumns[0];
// Group Column 1 by adding it to groupby collection
this.xamGridPrgProposal.GroupBySettings.GroupByColumns.Add(col1);
this.xamGridPrgProposal.GroupBySettings.ExpansionIndicatorVisibility = System.Windows.Visibility.Collapsed;
// Group Column 2 by setting its GroupBy property
col1.IsGroupBy = true;
this.xamGridPrgProposal.Columns.DataColumns[0].Visibility = System.Windows.Visibility.Collapsed;
this.xamGridPrgProposal.ColumnLayoutHeaderVisibility = ColumnLayoutHeaderVisibility.Always;
ok thanks Peter and Nikolay, i have the two solution (xaml and code behind), it's perfect !