windowsforms-devexpress-dot-xtrapivotgrid-99077185.md
Defines the calculation of a percentage of all values in the window.
Namespace : DevExpress.XtraPivotGrid
Assembly : DevExpress.XtraPivotGrid.v25.2.dll
NuGet Package : DevExpress.Win.PivotGrid
public class PercentOfTotalBinding :
PercentOfTotalBindingBase
Public Class PercentOfTotalBinding
Inherits PercentOfTotalBindingBase
To bind a PivotGrid field to the result of the calculation in Optimized mode, do the following:
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:
Run Demo: Optimized Mode - Field Calculation Bindings
[CodeExampleDataFile("nwind.xml")]
public static void PivotCalculations(PivotGridControl pivotGridControl) {
productAmountBinding, CalculationPartitioningCriteria.ColumnValueAndRowParentValue, RankType.Unique, PivotSortOrder.Descending);
//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(
pivotGridControl.BestFit();
Public Shared Sub PivotCalculations(ByVal pivotGridControl As PivotGridControl)
Dim productAmountBinding As New DataSourceColumnBinding("ExtendedPrice")
pivotGridControl.Fields("fPercentOfTotal").DataBinding = New PercentOfTotalBinding(productAmountBinding, CalculationPartitioningCriteria.ColumnValueAndRowParentValue)
End Sub
Object DataBindingBase CalculationBindingBase PercentOfTotalBindingBase PercentOfTotalBinding
See Also