Skip to main content

GridControl.GroupCount Property

Gets or sets the number of grouping columns.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v14.2.dll

#Declaration

[Browsable(false)]
[DefaultValue(0)]
[XtraSerializableProperty]
[GridUIProperty]
public int GroupCount { get; set; }

#Property Value

Type Default Description
Int32

0

An integer value that specifies the number of grouping columns.

#Remarks

To sort data in code, you should create a GridSortInfo object, specify its GridSortInfo.FieldName and GridSortInfo.SortOrder properties, and add it to the grid's GridControl.SortInfo collection. The first few objects contained within the GridControl.SortInfo collection correspond to grouping columns. The number of these objects is specified by the GroupCount property.

The grid automatically recalculates the GroupCount property's value each time the number of grouping columns is changed by an end-user or via code using the GridControl.GroupBy or GridControl.UngroupBy methods.

Setting the GroupCount property to a new value which is less than the current number of grouping columns, automatically ungroups data by the values of excess columns.

To learn more, see Grouping Overview.

See Also