Grouping Overview
- 2 minutes to read
#Grouping Overview
The DXGrid for Silverlight 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 handles. Group row handles are negative (starting from -1).
Rows are always sorted against grouping columns. If data is grouped against a column that 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 a list of grouping columns, allowing individual columns to be accessed using indexed notation.
By default, grouping columns are not displayed within a View. Their headers are displayed within the Group Panel. To show these columns from a View, set the GridViewBase.ShowGroupedColumns property to true.
#End-User Capabilities
End-users can group data in two ways.
- Drag a column's header to the group panel (requires the GridViewBase.ShowGroupPanel property to be set to true).
- Invoke a column's context menu by right-clicking its header and select the Group By This Column menu item.
Both methods are allowed if the view's GridViewBase.AllowGrouping property is set to true.
Individual columns provide the GridColumn.AllowGrouping property, allowing default behavior specified by the view to be overridden. For example, this allows preventing an end-user from grouping data by values of individual columns.
NOTE
Data grouping requires data sorting to be performed. End-users can only group data if data sorting is allowed (Data
#Concepts
- Group Modes and Custom Grouping
- Expanding and Collapsing Group Rows
- Processing Group Rows
- Grouping in Code
- Identifying Rows
- End-User Capabilities - Grouping