Log In
[Expand]General Information
[Collapse]WinForms Controls
 [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
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Data Shaping
       Automatic Totals
       Grand Totals
       Custom Totals
       Running Totals
      Aggregation Levels
     Data Formatting
   [Expand]Data Analysis
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Design-time Features
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [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]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Custom Totals

Automatic Totals and Custom Totals allow subtotals to be calculated against groups of data. These totals are calculated against a specific data field and they are displayed as an additional column(s) or row(s) for field values which have nested field values.

The following image shows a sample PivotGridControl which displays Automatic Totals:

In the following image the same Pivot Grid Control is shown with Custom Totals enabled for the Country field. The Custom Totals replace the Automatic Totals for this field. Custom totals are not specified for the Year field, so automatic totals are not displayed for this field's values:

The main differences between the Automatic and Custom Totals are listed in the following table:

Feature Automatic Totals Custom Totals
Association with fields Automatic totals are not associated with fields. They are calculated for all the field values which have nested field values. Custom totals are associated with column or row fields. They are only calculated for the values of associated fields provided that these values have nested field values. Custom totals replace automatic totals for these field values.
Collection of total objects The Pivot Grid Control doesn't provide a collection of automatic totals. The custom total collection can be accessed via the corresponding field's PivotGridField.CustomTotals property.
Number of Totals for individual field values The number of automatic totals displayed for a specific field value matches the number of data fields. The number of custom totals displayed for a specific field value is determined by the number of items in the field's custom total collection.
Summary type The type of summary function used to calculate an automatic total is determined by the corresponding data field's PivotGridFieldBase.SummaryType property. The type of summary function used to calculate a custom total is specified by the custom total object (specifically by its PivotGridCustomTotalBase.SummaryType property).

To display custom totals for a specific column/row field do the following:

Custom totals (as well as automatic totals) are calculated for field values which have nested field values, so the totals are not calculated for the values of the innermost column and row fields. If a specific field is not a column field nor a row field custom totals will not be calculated.

The PivotGridCustomTotal class which implements a custom total provides properties to specify the total's summary type, appearance settings and formatting settings.

Expanded See Also

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