Skip to main content

ColumnView.GroupCount Property

Gets or sets how many columns are used to group data.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v22.2.dll

NuGet Package: DevExpress.Win.Grid


public int GroupCount { get; set; }

Property Value

Type Default Description
Int32 0

The number of columns used to group data.


The GroupCount property is synchronized with the GridColumnSortInfoCollection.GroupCount property of the View’s ColumnView.SortInfo collection.

The View’s ColumnView.SortInfo property represents a collection of sorted columns. When grouping is applied, data is always sorted by the grouping columns first. So, the grouping columns always come first in the ColumnView.SortInfo collection. The GridColumnSortInfoCollection.GroupCount property (and therefore the current GroupCount property) specifies the number of elements starting from the beginning of the collection that refer to the columns used to group data. Set this property to 0 or a negative value to remove all the grouping, data will only be sorted by the columns in the collection.

Set this property to 1 to apply grouping by the first column and remove grouping by the subsequent columns. Setting the GroupCount property to a value greater than or equal to the number of elements in the collection will apply grouping to all the columns in the collection.

Card Views do not support data grouping. So changing the GroupCount property has no effect for Card Views.

See Also