windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnview-7f8170fa.md
Gets the collection of columns involved in data grouping.
Namespace : DevExpress.XtraGrid.Views.Base
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[Browsable(false)]
public GridColumnReadOnlyCollection GroupedColumns { get; }
<Browsable(False)>
Public ReadOnly Property GroupedColumns As GridColumnReadOnlyCollection
| Type | Description |
|---|---|
| GridColumnReadOnlyCollection |
A GridColumnReadOnlyCollection object representing a read-only collection of columns involved in grouping.
|
When grouping data by values of a column, the column is automatically added to the GroupedColumns collection. When canceling grouping by this column’s values, the column is removed from the collection. The column’s position within the collection matches the column’s GridColumn.GroupIndex property value.
To access all columns within a view, use the ColumnView.Columns property.
Note
The GroupedColumns collection contains only the first group column for merged group columns.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupedColumns 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.
winforms-reporting-create-grid-based-report/CS/ConvertGridToReportExample/XtraReport1.cs#L23
for (int i = gView.GroupCount - 1; i >= 0; i--)
InsertGroupBand(gView.GroupedColumns[i], i);
for (int i = 0; i < gView.Columns.Count; i++)
winforms-reporting-create-grid-based-report/VB/ConvertGridToReportExample/XtraReport1.vb#L21
For i As Integer = gView.GroupCount - 1 To 0 Step -1
InsertGroupBand(gView.GroupedColumns(i), i)
Next i
See Also