ColumnView.GroupCount Property

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

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

[Browsable(false)]
[DefaultValue(0)]
public int GroupCount { get; set; }
<Browsable(False)>
<DefaultValue(0)>
Public Property GroupCount As Integer

Property Value

Type Default Description
Int32

0

The number of columns used to group data.

Remarks

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