Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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*";
    }
}