Skip to main content

How to: Customize the Grand Total Text using the FieldValueDisplayText event

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


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

protected void ASPxPivotGrid1_FieldValueDisplayText(object sender, DevExpress.Web.ASPxPivotGrid.PivotFieldDisplayTextEventArgs e) {
    if (e.ValueType == DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal) {
        if (e.IsColumn)
            e.DisplayText = "*Custom Column Grand Total*";
            e.DisplayText = "*Custom Row Grand Total*";