Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Data Binding
   [Expand]Views
   [Expand]Data Editing and Validation
   [Collapse]Grouping
     Working with Groups in Code
   [Expand]Sorting
   [Expand]Filter and Search
   [Expand]Summaries
   [Expand]Focus and Selection Handling
    Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
    Scrolling
   [Expand]Batch Modifications
   [Expand]Hit Information
    Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[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

Grouping

The grouping feature combines rows with identical column values into the same data groups.

Expanded Apply Grouping

Data grouping is enabled in the Data Grid by default. To group data by a column, drag a column header into the group panel. Another option is to right-click a column header and select "Group By This Column". Both approaches work in Visual Studio and at runtime.

By default, when you group data by columns, these columns automatically hide from the View, and all groups collapse.

Related API

Expanded Ungroup Data

To ungroup data, drag a column header from the group panel to the column header panel, or right-click a column header and select "Ungroup" from the context menu. To remove all grouping, right-click the group panel and select "Clear Grouping".

Related API

  • OptionsColumn.AllowMove - prevents end-users from dragging a column header, including dragging it away from the group panel.
  • OptionsColumn.AllowGroup - disables the "Ungroup" option in the column context menu.
  • ColumnView.StartGrouping, ColumnView.EndGrouping - allow you to re-apply initial column grouping when end-users select "Clear Grouping" in the group panel context menu. The sample below restores grouping by the "Order ID" column when end-users clear grouping.

Expanded Multi-Column Grouping

When data is grouped by multiple columns, you can drag a column header to another position within the group panel to change the group order.

Related API

  • GridColumn.GroupIndex - accepts unique integer values that specify the group level for this column. Setting this property to -1 removes grouping by this column.
  • GridOptionsView.ShowGroupPanelColumnsAsSingleRow - if this setting is enabled, all column headers within a group panel are arranged in a line. In the figure below, data is grouped against "Country", "Region" and "Contact Title" columns. All three column headers are arranged in a line within the group panel.

Expanded Merged Column Grouping

Hold the Ctrl key when dragging column headers into the group panel to group data by multiple columns at once.

You can combine this merged grouping with regular multi-column grouping.

To re-arrange column headers within merged filter blocks, drag a column header with the same Ctrl key pressed.

Related API

GridOptionsCustomization.AllowMergedGrouping - disables the merged grouping feature.

Expanded Column Headers

Column headers within a group panel provide the same features as regular View columns: end-users can click a grouped column header to sort data ascending or descending, and invoke the filter menu to apply filtering.

Expanded Group Value Ranges

For DateTime columns, end-users can right-click a column header within the group panel and change the "Group Interval" setting.

Using the GridColumn.GroupInterval property, you can set the group interval for DateTime columns in code. For string columns, the "Alphabetic" and "Value" intervals are available. The figure below illustrates the "Alphabetical" group interval set for the "Ship Country" column.

Expanded Fixed Group Rows

Enable the GridOptionsBehavior.AllowFixedGroups to allow group rows to anchor to the View's top. This behavior allows end-users to identify what group they currently browse when scrolling through grouped data.

Expanded Draw Styles

Utilize the GridOptionsView.GroupDrawMode to switch between standard and Office-inspired draw modes for group rows. See the GroupDrawMode enumeration for more details.

Expanded Hide Single-Record Groups

Disable the GridOptionsBehavior.AllowPartialGroups to disable groups that contain only one data row. These data rows remain visible, but are displayed without parent groups and are separated from other data rows with blue lines.

When this option is enabled, column headers become visible in the Column Header Panel. Furthermore, group summaries are forcibly moved to group rows, and group footers then become hidden.

Expanded Master-Detail Grouping

Enable the GridOptionsView.ShowChildrenInGroupPanel setting to have one group panel for all Master-Detail views.

How would you rate this topic?​​​​​​​