The GridControl allows data to be grouped by an unlimited number of columns. When a View is grouped by a single column, data rows that have identical values in this column are arranged into groups. Each group is identified by a group row. If the View is grouped by another column, data rows within each group are arranged into second level groups based on the values of the new grouping column, etc.
Group rows are used to organize data rows into a tree when data grouping is applied. Each group row is assigned a unique integer value - row handle. Group row handles are negative (starting from -1).
Rows are always sorted against the grouping columns. If data is grouped against a column which isn't sorted, the grid will automatically apply sorting to the column in ascending order.
Grouping columns can be accessed via the GridViewBase.GroupedColumns property. This property returns the list of grouping columns, allowing individual columns to be accessed using indexed notation.
Individual columns provide the GridColumn.AllowGrouping property, allowing the default behavior specified by the view to be overridden. For example, this allows preventing an end-user from grouping data by the values of individual columns.
Data grouping requires data sorting to be performed. End-users can only group data if data sorting is allowed (DataViewBase.AllowSorting).