wpf-devexpress-dot-xpf-dot-grid-dot-gridcolumn-3177e1f7.md
Gets or sets the column’s position among grouping columns.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
[Browsable(false)]
public int GroupIndex { get; set; }
<Browsable(False)>
Public Property GroupIndex As Integer
| Type | Description |
|---|---|
| Int32 |
The column’s position among grouping columns. -1 if a View is not grouped by this column.
|
To group data against a column, set its GroupIndex property to a non-negative value.
If you group data against multiple columns, the GroupIndex property specifies the group level. In the following code sample, the City column has the 1 group level, and the Visits column has the 2 group level.
<dxg:GridColumn FieldName="City" IsSmart="True" GroupIndex="0"/>
...
<dxg:GridColumn FieldName="Visits" IsSmart="True" GroupIndex="1"/>
The following code snippets (auto-collected from DevExpress Examples) contain references to the GroupIndex property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-data-grid-process-frequent-data-updates/CS/ChunkAndOptSummariesExample/MainWindow.xaml#L27
<dxg:GridColumn FieldName="Name"/>
<dxg:GridColumn FieldName="Group" GroupIndex="0"/>
<dxg:GridColumn FieldName="Sensor1"/>
wpf-data-grid-display-group-summaries/CS/DisplayGroupSummaries_CodeBehind/MainWindow.xaml#L15
<dxg:GridColumn FieldName="RegistrationDate" />
<dxg:GridColumn FieldName="Married" GroupIndex="0" SortOrder="Ascending" />
<dxg:GridColumn FieldName="Age" />
wpf-data-grid-implement-custom-grouping/CS/CustomGrouping_CodeBehind/MainWindow.xaml#L15
<dxg:GridColumn FieldName="LastName" />
<dxg:GridColumn FieldName="UnitPrice" SortMode="Custom" GroupIndex="0">
<dxg:GridColumn.EditSettings>
wpf-data-grid-implement-custom-sorting/CS/CustomSorting_CodeBehind/MainWindow.xaml#L11
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Day" GroupIndex="0" SortMode="Custom"/>
<dxg:GridColumn FieldName="Employee"/>
wpf-data-grid-summarize-empty-cells/CS/CustomSummary_EmptyCells_CodeBehind/MainWindow.xaml#L12
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Text" GroupIndex="0" />
<dxg:GridColumn FieldName="Number" />
void OnEndGrouping(object sender, RoutedEventArgs e) {
if (grid.Columns[nameof(Invoice.Status)].GroupIndex == 0) {
var childRow = grid.FindRowByValue(grid.Columns[nameof(Invoice.Status)], InvoiceStatus.Invalidated);
See Also