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

PivotGridFieldBase.RunningTotal Property

Gets or sets whether Running totals are calculated for values in the Data Area that correspond to the current column or row field.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v19.1.Core.dll


public bool RunningTotal { get; set; }

Property Value

Type Default Description


true to calculate Running totals for the current column/row field; otherwise, false.


If the RunningTotal property is set to true, total values depend upon the order of values. End-users can change that order by sorting, grouping or filtering.

When filtering is applied, running totals do not include the values that have been filtered out.

Use the PivotGridOptionsData.AllowCrossGroupVariation property to specify whether running totals are calculated independently within individual groups, or throughout the Pivot Grid.

This example demonstrates how to include previous cell values in values of the next cell. To calculate cumulative values, set the PivotGridFieldBase.RunningTotal property of the corresponding field to true.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RunningTotal.DefaultForm" %>

<%@ Register Assembly="DevExpress.Web.ASPxPivotGrid.v19.1, Version=, Culture=neutral, PublicKeyToken=79868b8147b5eae4"
    Namespace="DevExpress.Web.ASPxPivotGrid" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v19.1, Version=, Culture=neutral, PublicKeyToken=79868b8147b5eae4"
    Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <form id="form1" runat="server">
        <table class="OptionsTable BottomMargin">
                    <dx:ASPxCheckBox ID="cbRunningTotals" runat="server" Text="Include Previous Quarter Sales into the Values of the Next Quarter"
                        Checked="True" AutoPostBack="True" />
                    <dx:ASPxCheckBox ID="cbAllowCrossGroupRunningTotals" runat="server" Text="Allow Cross-Group Running Totals Accumulation"
                        Checked="False" AutoPostBack="True" />
        <dx:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server" DataSourceID="NwindDataSource"
            CssClass="" Width="100%">
            <OptionsView ShowFilterHeaders="False" ShowColumnTotals="False" />
                <dx:PivotGridField Area="RowArea" AreaIndex="0" FieldName="ProductName" ID="fieldProductName"
                    Caption="Product" />
                <dx:PivotGridField Area="ColumnArea" AreaIndex="0" FieldName="OrderDate" ID="fieldOrderDate"
                    Caption="Year" GroupInterval="DateYear" />
                <dx:PivotGridField Area="ColumnArea" AreaIndex="1" FieldName="OrderDate" Caption="Quarter"
                    GroupInterval="DateQuarter" ID="fieldQuarter" ValueFormat-FormatString="Qtr {0}"
                    ValueFormat-FormatType="Numeric" />
                <dx:PivotGridField Area="DataArea" AreaIndex="0" FieldName="ProductAmount" ID="fieldProductAmount"
                    Caption="Product Sales" />
            <OptionsView HorizontalScrollBarMode="Auto" />
            <OptionsFilter NativeCheckBoxes="False" />
        <asp:AccessDataSource ID="NwindDataSource" runat="server" DataFile="~/App_Data/nwind.mdb"
            SelectCommand="SELECT * FROM [CustomerReports]"></asp:AccessDataSource>
See Also