PercentOfTotalBinding Class
Defines the calculation of a percentage of all values in the window.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.2.dll
Declaration
Remarks
To bind a PivotGrid field to the result of the calculation in Optimized mode, do the following:
- Create an instance of the PercentOfTotalBinding class.
- Set the Source property to the DataBindingBase descendant instance.
- Specify the window frame.
- Assign the PercentOfTotalBinding instance to the PivotGridField.DataBinding property.
Example
The following code snippet illustrates the use of the Data Binding API to calculate the percentage of each value in the column out of the sum of the values in a pivot field group:
public static void PivotCalculations(PivotGridControl pivotGridControl) {
DataSourceColumnBinding productAmountBinding = new DataSourceColumnBinding("ExtendedPrice");
//Calculate the percentage of each value in the column out of the sum of the values in a pivot field group.
pivotGridControl.Fields["fPercentOfTotal"].DataBinding = new PercentOfTotalBinding(
productAmountBinding, CalculationPartitioningCriteria.ColumnValueAndRowParentValue);
}
Inheritance
Object
DataBindingBase
CalculationBindingBase
PercentOfTotalBindingBase
PercentOfTotalBinding
See Also