[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Collapse]Grouping
     Grouping Overview
     Group Modes and Custom Grouping
     Expanding and Collapsing Group Rows
     Processing Group Rows
     Grouping in Code
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Grouping Overview

Expanded Grouping Overview

The DXGrid 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.

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.

It is possible to hide the group row for groups that consist of a single row. To do this, set the TableView.AllowPartialGrouping property to true. When this option is enabled, grouped columns are displayed within a view regardless of the current value of the GridViewBase.ShowGroupedColumns property. This feature is not compatible with the Instant Feedback UI Mode.

Expanded 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 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.

Note

Data grouping requires data sorting to be performed. End-users can only group data if data sorting is allowed (DataViewBase.AllowSorting).

Expanded Concepts

Expanded Examples

Is this topic helpful?​​​​​​​