Totals Overview
- 2 minutes to read
PivotGridControl supports three types of totals: automatic totals (subtotals), custom totals and grand total. Totals are displayed as additional columns (column totals) or rows (row totals) and contain summarized data.
#Automatic Totals (Subtotals)
Automatic totals are calculated using a summary function specified by the corresponding data field (PivotGridField.SummaryType). These totals are automatically calculated for groups of data, and displayed for field values which have nested field values.
An automatic total is calculated for each data field. By default, if there are multiple data fields, the DXPivotGrid control displays multiple column totals and a single row total for each field value. In the image below, the DXPivotGrid control has two data fields. It displays two column totals and a single row total for appropriate field values.
To display multiple row totals and a single column total, set the PivotGridControl.DataFieldArea property to FieldArea.RowArea.
By default, a subtotal is not displayed if a field value has a single nesting field value. To display totals for such field values, set the PivotGridControl.ShowTotalsForSingleValues property to true.
To specify the visibility of all column and row subtotals, use the PivotGridControl.ShowColumnTotals and PivotGridControl.ShowRowTotals properties. To hide totals which correspond to an individual data field, set its PivotGridField.ShowTotals property to false.