Skip to main content

PivotGridField.CustomTotals Property

Gets the current field’s custom total collection.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v23.1.dll

NuGet Package: DevExpress.Wpf.PivotGrid


public PivotGridCustomTotalCollection CustomTotals { get; }

Property Value

Type Description

A PivotGridCustomTotalCollection object which represent the custom totals’ collection.


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 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 PivotGridField.TotalsVisibility property is set to FieldTotalsVisibility.CustomTotals.


The following example demonstrates how to add custom totals for a particular pivot grid field.

In this example, four different totals are added for the Category Name row field: Average, Sum, Min and Max. For this, they should be added to the PivotGridField.CustomTotals property and the PivotGridField.TotalsVisibility property should be set to FieldTotalsVisibility.CustomTotals.

View Example

<Window x:Class="HowToBindToMDB.MainWindow"
        Title="MainWindow" Height="350" Width="525"  Loaded="Window_Loaded">
        <dxpg:PivotGridControl HorizontalAlignment="Left" Name="pivotGridControl1" 
                               VerticalAlignment="Top" RowTotalsLocation="Far">
                <dxpg:PivotGridField Name="fieldCategoryName" FieldName="CategoryName" 
                                     Area="RowArea" Caption="Category"
                        <dxpg:PivotGridCustomTotal SummaryType="Average" />
                        <dxpg:PivotGridCustomTotal SummaryType="Sum" />
                        <dxpg:PivotGridCustomTotal SummaryType="Max" />
                        <dxpg:PivotGridCustomTotal SummaryType="Min" />
                <dxpg:PivotGridField Name="fieldProductName" FieldName="ProductName" Area="RowArea"
                                     Caption="Product Name" />
                <dxpg:PivotGridField Name="fieldOrderYear" FieldName="OrderDate" Area="ColumnArea"
                                     Caption="Order Year" GroupInterval="DateYear" />
                <dxpg:PivotGridField Name="fieldExtendedPrice" FieldName="Extended Price"
                                     Area="DataArea" CellFormat="c0" />

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomTotals 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