DifferenceBinding Class
Defines the difference calculation between values across a window.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.1.dll
NuGet Package: DevExpress.Win.PivotGrid
Declaration
Remarks
To bind a PivotGrid field to the result of the difference window calculations in Optimized mode, do the following:
- Create an instance of the DifferenceBinding class.
- Set the Source property to the DataBindingBase descendant instance.
- Specify the window frame and calculation settings.
- Assign the DifferenceBinding instance to the PivotGridField.DataBinding property.
Example
The following code snippet illustrates the use of the Data Binding API to calculate a difference between the preceding and current value in the column:
public static void PivotCalculations(PivotGridControl pivotGridControl) {
DataSourceColumnBinding productAmountBinding = new DataSourceColumnBinding("ExtendedPrice");
//Calculate a difference between the preceding and current value in the column.
pivotGridControl.Fields["fDifference"].DataBinding = new DifferenceBinding(
productAmountBinding, CalculationPartitioningCriteria.ColumnValue, DifferenceTarget.Previous, DifferenceType.Absolute);
}
Inheritance
See Also