Skip to main content

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.v23.2.dll

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public class PercentOfTotalBinding :
    CalculationBinding

Remarks

Do the following to bind a Pivot Grid field to the result of the calculation in Optimized mode:

  1. Create an instance of the PercentOfTotalBinding class with the Source property set to the DataBinding descendant instance.
  2. Specify the window frame.
  3. 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.

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.

See Also