Back to Devexpress

PivotGridFieldOptions.ShowTotals Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldoptions-9f1584ed.md

latest5.3 KB
Original Source

PivotGridFieldOptions.ShowTotals Property

Gets or sets whether Totals that correspond to the current data field are visible.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.PivotGrid.v25.2.Core.dll

NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(true)]
public bool ShowTotals { get; set; }
vb
<DefaultValue(True)>
Public Property ShowTotals As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if corresponding automatic totals are visible; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowTotals
PivotGridFieldBase

.Options .ShowTotals

|

Remarks

Use the PivotGridOptionsViewBase.ShowColumnTotals, PivotGridOptionsViewBase.ShowRowTotals and PivotGridOptionsViewBase.ShowTotalsForSingleValues properties to control the visibility of automatic totals for all PivotGridControl’s fields.

The following code snippet shows how to disable totals for the CategoryName field.

csharp
using DevExpress.XtraPivotGrid;
// ...
PivotGridField fieldCategory = new PivotGridField("CategoryName", PivotArea.RowArea);
pivotGridControl.Fields.Add(fieldCategory);
fieldCategory.Options.ShowTotals = false;
vb
Imports DevExpress.XtraPivotGrid
' ...
Private fieldCategory As New PivotGridField("CategoryName", PivotArea.RowArea)
pivotGridControl.Fields.Add(fieldCategory)
fieldCategory.Options.ShowTotals = False

Note

The row fields’ ShowTotals properties are ignored when the PivotGridOptionsViewBase.RowTotalsLocation property is set to PivotRowTotalsLocation.Tree.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowTotals property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/CS/PivotGridCustomSummaryExample/Form1.cs#L70

csharp
// Hide totals for the Value field.
pivotGridControl1.Fields["Value"].Options.ShowTotals = false;
pivotGridControl1.Fields["Value"].Options.ShowGrandTotal = false;

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/VB/PivotGridCustomSummaryExample/Form1.vb#L56

vb
' Hide totals for the Value field.
pivotGridControl1.Fields("Value").Options.ShowTotals = False
pivotGridControl1.Fields("Value").Options.ShowGrandTotal = False

See Also

ShowGrandTotal

ShowValues

ShowColumnTotals

ShowRowTotals

ShowTotalsForSingleValues

TotalsVisibility

PivotGridFieldOptions Class

PivotGridFieldOptions Members

DevExpress.XtraPivotGrid Namespace