[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
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Data Shaping
       Summary Overview
       Automatic Summaries
       Custom Summaries
      [Expand]Summary Display Modes
       Accessing Summary Values
       Drill Down to the Underlying Data
      Aggregation Levels
    [Expand]Data Formatting
   [Expand]Data Analysis
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
  [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)

Custom Summaries

Custom summaries allow you to calculate summaries at your discretion. Custom summaries can do the following:

  • calculate a custom summary function;
  • involve multiple fields in summary calculation;
  • calculate a summary for records that match certain criteria.

Perform the following steps in Optimized mode:

The Pivot Grid control in Legacy and LegacyOptimized mode (before v19.2) can handle the PivotGridControl.CustomSummary event to implement a custom summary calculation routine. This approach can potentially degrade the performance.


In a custom summary calculation requires SELECT (to select from additional data sources) or JOIN operations, you can create a FederationDataSource and bind it to the Pivot Grid fields.

Expanded Example: How to Calculate Custom Summaries

This example demonstrates how to count distinct values (the number of orders with equal product quantities) and display the result in the pivot grid.

This example handles the PivotGridControl.CustomSummary event that occurs when the control calculates a summary for a field whose SummaryType (see PivotGridFieldBase.SummaryType) is PivotSummaryType. The event handler calls the PivotGridCustomSummaryEventArgsBase`1.CreateDrillDownDataSource method to retrieve the underlying data rows for the current cell, counts distinct values and returns the result to the PivotGridCustomSummaryEventArgsBase`1.CustomValue property.


The complete sample project How to Create a Custom Summary Type to Display the Distinct Value Count is available in the DevExpress Examples repository.


Custom summaries calculated using the PivotGridControl.CustomSummary event are not supported in server and OLAP modes.

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