[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
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Collapse]Data Summaries
     Data Summaries Overview
     Total Summary
     Group Summary
     Node Summary
     Custom Summary
     Runtime Summary Editor
   [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)

Group Summary

A group summary represents a value of the aggregate function calculated over all data rows within a group. Group summaries are displayed within group rows, and are stored within the grid's GridControl.GroupSummary collection.

Expanded Displaying Group Summaries

To create a group summary item at design time, use the GroupSummary Collection Editor.

To display group summaries in code, create a new instance of the GridSummaryItem class, specify its properties and add it to the GridControl.GroupSummary collection.

Expanded Obtaining Summary Values

To obtain a group summary value displayed within the specified group row, use the GridControl.GetGroupSummaryValue method.

Expanded Align Group Summaries by Columns

By default, group summaries are displayed to a group row's right. To display group summaries under corresponding columns, set the TableView.GroupSummaryDisplayMode to GroupSummaryDisplayMode.AlignByColumns.

Expanded Group Footers

To show group footer rows, use the view's TableView.ShowGroupFooters property. To display a summary item within group footer rows, use its GridSummaryItem.ShowInGroupColumnFooter property.

Expanded Group Summaries Appearance Customization

The GridViewBase.GroupSummaryItemTemplate property allows you to change the presentation of the group summaries. The following code shows you how to change the group summary caption and background color using a custom template.

In case the TableView.GroupSummaryDisplayMode property is set to AlignByColumns, TableView.GroupColumnSummaryItemTemplate should be used to define a group summary template. The code example below shows how to display two group summaries aligned by columns with a custom background.

You can also define multiple templates and implement custom logic to choose the required one. To do this, use the GridViewBase.GroupSummaryItemTemplateSelector property.

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