Skip to main content
A newer version of this page is available. .

GridColumn.GroupIndex Property

Gets or sets the value specifying whether the column takes part in grouping and at which level.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v17.2.dll

Declaration

[XtraSerializablePropertyId(2)]
[DefaultValue(-1)]
[DXCategory("Data")]
public int GroupIndex { get; set; }

Property Value

Type Default Description
Int32

-1

An integer value specifying the column’s position among grouping columns. -1 if the View is not grouped by this column’s values.

Remarks

Grid Views support data grouping by an unlimited number of columns. To group data by the values of a given column, set the column’s GroupIndex property to a non-negative integer. If several columns are involved in grouping, the GroupIndex property specifies the grouping level. If set to 0, the column is at the root grouping level. Note that changing the GroupIndex property value updates this property value for other columns involved in grouping.

Set the GroupIndex property to -1 to cancel grouping by the column’s values. To clear grouping completely, call the View’s GridView.ClearGrouping method.

As data is grouped by column values, the column is added to the ColumnView.GroupedColumns collection. The GroupIndex property value matches the column’s position within that collection.

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.

See Also