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.v24.1.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

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

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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupCount 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