wpf-devexpress-dot-xpf-dot-pivotgrid-620eb395.md
Allows you to calculate the input of all values in the window as a percentage of the total.
Namespace : DevExpress.Xpf.PivotGrid
Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll
NuGet Package : DevExpress.Wpf.PivotGrid
public class PercentOfTotalBinding :
CalculationBinding
Public Class PercentOfTotalBinding
Inherits CalculationBinding
Do the following to bind a Pivot Grid field to the result of the calculation in Optimized mode:
PercentOfTotalBinding class with the Source property set to the DataBinding descendant instance.PercentOfTotalBinding instance to the PivotGridField.DataBinding property.The example below shows how to use PercentOfTotalBinding to display the percentage of total sales in the Pivot Grid.
View Example: Pivot Grid Optimized Mode - Field Calculation Data Binding
<dxpg:PivotGridControl
<!-- ... -->
DataProcessingEngine="Optimized"
<!-- ... -->
<dxpg:PivotGridControl.Fields>
<!-- ... -->
<dxpg:PivotGridField
Area="DataArea"
AreaIndex="0"
Caption="Percent of Total"
CellFormat="P1"
Name="fieldPercentOfTotal">
<dxpg:PivotGridField.DataBinding>
<dxpg:PercentOfTotalBinding PartitioningCriteria="ColumnValueAndRowParentValue">
<dxpg:PercentOfTotalBinding.Source>
<dxpg:DataSourceColumnBinding ColumnName="Extended Price" />
</dxpg:PercentOfTotalBinding.Source>
</dxpg:PercentOfTotalBinding>
</dxpg:PivotGridField.DataBinding>
</dxpg:PivotGridField>
<!-- ... -->
</dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PercentOfTotalBinding class.
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.
<dxpg:PivotGridField.DataBinding>
<dxpg:PercentOfTotalBinding PartitioningCriteria="ColumnValue">
<dxpg:PercentOfTotalBinding.Source>
Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement DataBinding CalculationBinding PercentOfTotalBinding
See Also