Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[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
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   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]Diagram Control
  [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 Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Group Modes and Custom Grouping

Expanded Group Modes

Interval grouping

By default, when grouping by date/time values, only the date portion of values is taken into account, while the time portion is ignored. Rows that contain matching date portions, but different time portions in a grouping column, are combined into a single group.

The default grouping logic is used if grouping columns contain other data types. In this instance, rows are combined into a single group, if they have a matching value in a grouping column.

The Interval Grouping feature allows you to change the default logic. Use the column's GridColumn.GroupInterval property to specify the required grouping mode.

The image below shows how the data rows can be arranged by the month or year part of a date/time value, or grouped by the first characters.

Merged Grouping

Set the GridViewBase.AllowMergedGrouping property to true to enable the Merged Grouping feature which allows grouping grid data by multiple columns at once.

Merged grouping can work in the following modes that you can specify using the GridViewBase.MergedGroupingMode property:

Mode Description
MergedGroupingMode.CtrlKeyPressed (default mode) End-users should hold the Ctrl key pressed when dragging column headers into the group panel to merge groups.
MergedGroupingMode.Always Grid always merges groups when end-users drag column headers into the group panel.

Expanded Custom Grouping

You can implement custom logic if the built-in grouping modes do not suit your requirements by setting the ColumnBase.SortMode property to 'Custom' and handling the GridControl.CustomColumnGroup event. Handle the GridControl.CustomGroupDisplayText event to change the default text displayed within group rows.

Expanded Example

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E1530.

This example shows how to group rows using custom rules. When grouping by the 'Unit Price' column, the rows in this column that have values between 0 and 10 should be combined into a single group. Rows whose values fall between 10 and 20 should be combined into another group, etc.

Expanded See Also

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