[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
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
     Grouping Overview
     Group Modes and Custom Grouping
     Expanding and Collapsing Group Rows
     Processing Group Rows
     Grouping in Code
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus, Navigation, Selection
   [Expand]Conditional Formatting
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [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
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Processing Group Rows

Expanded Group Rows and Group Levels

When grouping is applied, group rows organize data into a tree. Group rows are virtual objects. They do not exist in the grid's data source. Group rows are automatically created when data grouping is applied to combine records with identical values within grouping columns. Ungrouping data automatically removes group rows. Data rows are displayed at the bottommost hierarchy level, and can be accessed by expanding group rows.

Group rows are uniquely identified by their handles. Group row handles are negative (starting from -1), determining the order in which group rows appear within a View according to the sorting and filtering settings. Refer to the Identifying Rows and Cards topic for more information.

Method Description
GridControl.IsGroupRowHandle Gets whether a row handle corresponds to a group row.
GridControl.GetRowLevelByRowHandle, GridControl.GetRowLevelByVisibleIndex Obtains the grouping level at which a row (group or data row) resides.

Expanded Get Group Row Info

Method Description
GridControl.GetGroupRowValue Returns a value of the specified group row.
GridControl.GetGroupSummaryValue Returns the specified group summary value displayed within the specified Group Row.

Expanded Iterate Through Child Rows

To iterate through the child rows belonging to a group row, use the following methods:

Method Description
GridControl.GetChildRowCount Returns the number of child rows (group or data) contained within the specified group row.
GridControl.GetChildRowHandle Returns the handle of the row contained within the specified group row, at the specified position.
GridControl.GetParentRowHandle Returns the handle of the group row that owns the specified group or data row.

Expanded Example: How to Obtain the Number of Group Rows Displayed within a View

This example shows how to obtain the total number of group rows displayed within a view.

The total number of visible rows is returned by the DataControlBase.VisibleRowCount property. The GridControl.GetRowHandleByVisibleIndex method is used to obtain the processed row's handle by its position within the view. The GridControl.IsGroupRowHandle method is used to identify whether the processed row is the group row.

Expanded Custom Group Display Text

Member Description
GridControl.CustomGroupDisplayText Allows you to replace the default text within group rows. You can use methods listed in the Obtain and Set Cell Values in Code topic to obtain the required column values and set the DisplayText property to a string value you want to display.
GridColumn.GroupValueTemplate, GridViewBase.GroupValueTemplate Allows you to specify a template that defines the group row's appearance.

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