Skip to main content

PivotGridField.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. This is a dependency property.

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid


public FieldTotalsVisibility TotalsVisibility { get; set; }

Property Value

Type Description

A FieldTotalsVisibility 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 DXPivotGrid 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 PivotGridField.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 PivotGridCustomTotal.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 FieldTotalsVisibility.None neither an automatic nor custom total is displayed for the values of this field.


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


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