Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Fundamentals
   [Expand]Binding to Data
   [Collapse]Data Shaping
    [Collapse]Summarization
     [Expand]Summaries
     [Collapse]Totals
       Automatic Totals
       Grand Totals
       Custom Totals
       Running Totals
      Aggregation Levels
     Grouping
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Editing
     Data Formatting
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Appearance
   [Expand]Design-time Features
   [Expand]Miscellaneous
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [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]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Totals

The PivotGridControl calculates summary values (totals) and displays them as additional columns or rows. The following types of totals are supported:

Expanded Automatic Totals

The automatic totals can be divided into two types:

  • Row/column totals display sub-totals calculated for outer row/column fields.
  • Row/column grand totals display summary totals calculated against all the rows/columns.

The automatic totals are calculated using a summary function the corresponding data field specifies.

You can access the totals and grand totals settings using the PivotGridControl.OptionsView property. The table below lists the common members that configure automatic totals:

Member Description
PivotGridFieldOptions.ShowTotals Gets or sets whether Totals that correspond to the current data field are visible.
PivotGridOptionsViewBase.ShowRowTotals Gets or sets whether to display row automatic Totals.
PivotGridOptionsViewBase.ShowColumnTotals Gets or sets whether to display column automatic Totals.
PivotGridOptionsViewBase.ColumnTotalsLocation Gets or sets the column totals' location.
PivotGridOptionsViewBase.RowTotalsLocation Gets or sets the totals' and grand totals' location.
PivotGridOptionsViewBase.ShowColumnGrandTotals Gets or sets whether to display column Grand Totals.
PivotGridOptionsViewBase.ShowRowGrandTotals Gets or sets whether to display row Grand Totals.
Note

See the PivotGridOptionsViewBase class members to get a full list of members you can use to configure totals.

Use custom totals to calculate totals using a different summary function, or to calculate multiple subtotals.

Expanded Custom Totals

You may need to manually specify how many and what type of totals to display for each field. The custom totals replace automatic totals and can be calculated using various aggregation functions like Sum, Min, Max, Average, etc. The number of totals depends on how many items you add to the field's custom total collection.

For example, the image below shows the Category Name field displaying Sum and Max totals:

The sample code below allows you to create the same layout as the image above:

The following table lists the members you can use to configure custom totals:

Member Description
PivotGridFieldBase.TotalsVisibility Gets or sets whether to display totals for the current field when it is in the Column Header Area or Row Header Area and if so, whether they are automatic or custom.
PivotGridField.CustomTotals Gets the current field's custom total collection.
PivotGridCustomTotalBase.SummaryType Gets or sets the type of the summary function used to calculate the current custom total.

Expanded Running Totals

Running totals allow you to calculate cumulative values that correspond to the specified column or row fields. For instance, in the PivotGridControl below, running totals are enabled for the Quarter field:

In the result, the PivotGrid control in the image below displays cumulative sales for each quarter over a two-year period:

Note that cumulative values depend on the values' order. End-users can change the order by sorting, grouping or filtering.

You can specify whether running totals are calculated independently within individual groups, or for the entire PivotGrid. In the image below, running totals for the Quarter field are calculated independently for each year (cross-group variation is disabled):

The table below lists the members you can use to configure running totals:

Member Description
PivotGridFieldBase.RunningTotal Gets or sets whether Running totals are calculated for values in the Data Area that correspond to the current column or row field.
PivotGridOptionsData.AllowCrossGroupVariation Gets or sets whether summary variations and running totals are calculated independently within individual groups, or throughout the Pivot Grid.

Expanded See Also

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