Skip to main content

PivotGridCustomTotal Class

Represents a custom total.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid


public class PivotGridCustomTotal :


Custom totals are stored within a field’s PivotGridField.CustomTotals collection. To display custom totals for a column or row field, do the following:

Custom totals (like automatic totals) are calculated for field values which have nested field values. They are not calculated for the values of the innermost column and row fields. If a field is not a column field or row field, custom totals are not calculated for it.


To learn more, see Totals.


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" />
See Also