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

Hide Column Totals

This example demonstrates how to handle the CustomCellValue event to hide the Discount field grand totals.

View Example: Pivot Grid for WPF - Hide Column Totals

Hide column totals

private void PivotGridControl1_CustomCellValue(object sender,PivotCellValueEventArgs e) {
    if (e.ColumnValueType == FieldValueType.GrandTotal
           && e.DataField == fieldDiscount)
        e.Value = null;
}
<dxpg:PivotGridControl DataProcessingEngine="Optimized" 
                       Name="pivotGridControl1" 
                       CustomCellValue="PivotGridControl1_CustomCellValue">
        <dxpg:PivotGridControl.Fields>
        <!-- ... -->
        <dxpg:PivotGridField Name="fieldDiscount" Area="DataArea" CellFormat="p">
            <dxpg:PivotGridField.DataBinding>
                <dxpg:DataSourceColumnBinding ColumnName="Discount"/>
            </dxpg:PivotGridField.DataBinding>
        </dxpg:PivotGridField>
        <!-- ... -->
    </dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>