PercentOfTotalBinding Class
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.v24.2.dll
NuGet Package: DevExpress.Wpf.PivotGrid
Declaration
Remarks
Do the following to bind a Pivot Grid field to the result of the calculation in Optimized mode:
- Create an instance of the
PercentOfTotalBinding
class with theSource
property set to the DataBinding descendant instance. - Specify the window frame.
- Assign the
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.
<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>
Related GitHub Examples
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.