Skip to main content

PivotGridFieldBase.TotalsVisibility Property

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.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v22.2.Core.dll

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Dashboard.Design


public PivotTotalsVisibility TotalsVisibility { get; set; }

Property Value

Type Default Description
PivotTotalsVisibility AutomaticTotals

A PivotTotalsVisibility value that specifies which totals are displayed for the current field.

Available values:

Name Description

Specifies that automatic totals are calculated.


Specifies that custom totals are calculated using the formula in the PivotGridField.CustomTotals collection.


Specifies that a summary total is not calculated.


The XtraPivotGrid control lets you calculate automatic or custom totals against data fields. These totals are displayed as an additional column(s) for each value of an outer column field and as an additional row for each value of an outer row field.

For each data field a single automatic total is calculated, and its summary function is determined by the field’s PivotGridFieldBase.SummaryType property. The number of automatic totals displayed for each value of an outer field matches the number of data fields.

Custom totals allow you to calculate multiple totals against each data field. A custom total is represented by the PivotGridCustomTotal class and its PivotGridCustomTotalBase.SummaryType property identifies the summary function type used to calculate the total.

To display custom totals instead of the automatic totals for the values of an outer column or row field, you should do the following:

If the TotalsVisibility property of an outer column or row field is set to PivotTotalsVisibility.None neither an automatic nor custom total is displayed for the values of this field.


The row fields’ TotalsVisibility properties are ignored when the PivotGridOptionsViewBase.RowTotalsLocation property is set to PivotRowTotalsLocation.Tree.


In the following example, four custom totals are added for a ‘Category Name’ row field. They will calculate the total Average, Sum, Min and Max values against the currently displayed data field.

The result is shown below.


using DevExpress.Data.PivotGrid;
using DevExpress.XtraPivotGrid;

// Get a reference to the CategoryName field.
PivotGridField field = pivotGridControl1.Fields["CategoryName"];
try {
   // Clear the custom total collection.
   // Add four items to the custom total collection to calculate the Average, 
   // Sum, Max and Min summaries.
   // Make the custom totals visible for this field.
   field.TotalsVisibility = PivotTotalsVisibility.CustomTotals; 
finally {

The following code snippets (auto-collected from DevExpress Examples) contain references to the TotalsVisibility property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also