Skip to main content

DifferenceBinding Class

Defines the difference calculation between values across a window.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v23.2.dll

NuGet Package: DevExpress.Wpf.PivotGrid

Declaration

public class DifferenceBinding :
    DirectedCalculationBinding

Remarks

To bind a Pivot Grid field to the result of the calculation in Optimized mode, do the following:

  1. Create an instance of the DifferenceBinding class with the Source property set to the DataBinding descendant instance.
  2. Specify the window frame and calculation settings.
  3. Assign the DifferenceBinding instance to the PivotGridField.DataBinding property.

The example below shows how to use DifferenceBinding to display the absolute difference between the Extended Price field values.

View Example: Pivot Grid Optimized Mode - Field Calculation Data Binding

<dxpg:PivotGridControl
<!-- ... -->
    DataProcessingEngine="Optimized"
    <!-- ... -->
    <dxpg:PivotGridControl.Fields>
    <!-- ... -->
        <dxpg:PivotGridField
            Area="DataArea"
            AreaIndex="2"
            Caption="Difference"
            Name="fieldDifference">
            <dxpg:PivotGridField.DataBinding>
                <dxpg:DifferenceBinding
                    DifferenceType="Absolute"
                    PartitioningCriteria="ColumnValue"
                    Target="Previous">
                    <dxpg:DifferenceBinding.Source>
                        <dxpg:DataSourceColumnBinding ColumnName="Extended Price" />
                    </dxpg:DifferenceBinding.Source>
                </dxpg:DifferenceBinding>
            </dxpg:PivotGridField.DataBinding>
        </dxpg:PivotGridField>
        <!-- ... -->
    </dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
See Also