A newer version of this page is available. Switch to the current version.

PivotGridField.CustomTotals Property

Gets the current field's custom total collection.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v19.1.dll


[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, true, true, 0, XtraSerializationFlags.DefaultValue)]
public PivotGridCustomTotalCollection CustomTotals { get; }
<XtraSerializableProperty(XtraSerializationVisibility.Collection, True, True, True, 0, XtraSerializationFlags.DefaultValue)>
Public ReadOnly Property CustomTotals As PivotGridCustomTotalCollection

Property Value

Type Description

A PivotGridCustomTotalCollection object which represent the custom totals' collection.


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

The CustomTotals collection contains PivotGridCustomTotal objects which represent custom totals for the current field. They are displayed when the field is positioned within the Column Header Area or Row Header Area and only if its PivotGridFieldBase.TotalsVisibility property is set to PivotTotalsVisibility.CustomTotals.


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 {
See Also