Skip to main content

How to: Customize the Grand Total Text in the FieldValueDisplayText Event

The PivotGridControl.FieldValueDisplayText event allows you to customize field value texts for grand totals.

WpfPivot_CustomGrandTotalText

To do this, check the field value type using the PivotFieldValueEventArgs.ValueType event parameter and provide the required display texts using PivotFieldDisplayTextEventArgs.DisplayText.

private void PivotGridControl_FieldValueDisplayText(object sender, DevExpress.Xpf.PivotGrid.PivotFieldDisplayTextEventArgs e) {
    if (e.ValueType == DevExpress.Xpf.PivotGrid.FieldValueType.GrandTotal) {
        if (e.IsColumn)
            e.DisplayText = "*Custom Column Grand Total*";
        else
            e.DisplayText = "*Custom Row Grand Total*";
    }
}