[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]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Collapse]Data Grid
   [Collapse]Getting Started
     Lesson 1 - Adding GridControl to a Project
     Lesson 2 - Data Editing and Displaying
     Lesson 3 - Data Management
     Lesson 4 - Grid Summaries
     Lesson 5 - Setup Master-Detail Hierarchy
   [Expand]Implementation Details
   [Expand]Grid View Data Layout
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Filtering and Searching
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [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)

Lesson 4 - Grid Summaries

The GridControl allows you to display concise information about groups of rows. For example, you can display the number of records or maximum value, etc. This is called a summary.

The summary can be calculated over all data rows (total summaries) and over data rows in a group (group summaries).

This topic will teach you how to enable data summaries for the GridControl.

Expanded Total Summaries

A total summary is a value of an aggregate function calculated over all data rows within a View and displayed within a summary panel.

Learn more: Total Summary

Expanded Group Summaries

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 or group footers.

Learn more: Group Summary

Expanded Summary Types (Aggregate Functions)

Total summaries and group summaries provide five predefined aggregate functions. These functions allow you to calculate:

  • the number of data rows (Count);
  • the maximum and minimum values (MAX and MIN);
  • the sum and the average value (SUM and AVG).

Learn more: Custom Summary

Expanded Adding Summary to a GridControl

You can add a summary to your GridControl by populating the GridControl.TotalSummary or GridControl.GroupSummary collection for total and group summaries respectively

To add a summary at design time, perform the following steps.

  1. Navigate to the GridControl properties, expand the "Data" section.

  2. Open the required data summary editor (GroupSummary or TotalSummary)

In the opened GridSummaryItem Collection Editor:

  1. add a new GridSummaryItem;
  2. define its FieldName and SummaryType properties;
  3. apply changes by clicking OK.

The code example below demonstrates the applied changes in XAML code.

Run the application. The image below illustrates the result.

In this tutorial, the total summary is calculated by the values of the "Name" column that is defined using the FieldName property. The SummaryType property defines the aggregate function used to calculate the total summary value. In this tutorial, the SummaryType property value is set to Count, which means the total summary displays the number of data rows.

Expanded Applying Summaries by End-Users

To add or change the summary for a specific column, your end-user should right-click a region within a group footer or grid footer under a specific column. This will invoke a context menu displaying a list of supported summary types. Your end-user needs to select the required summary type in the context menu.

Expanded Next Steps

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