ExpressionDataBinding Class
Defines a calculation based on a string expression.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v19.2.dll
Declaration
Remarks
To bind a PivotGrid field to the result of the calculation, perform the following steps:
- Create an instance of the ExpressionDataBinding class.
- Specify the expression.
- Assign the ExpressionDataBinding instance to the PivotGridField.DataBinding property.
Example
The following code snippet illustrates the use of the Data Binding API:
Note
The complete sample project is available in the DevExpress Demo Center: Code Examples - Intermediate Level Aggregations (Optimized Mode) - Grouping by Year of First Sale module in the XtraPivotGrid MainDemo.
pivotGridControl.OptionsData.DataProcessingEngine = PivotDataProcessingEngine.Optimized;
PivotGridField yearOfFirstSale = new PivotGridField()
{
Area = PivotArea.RowArea,
AreaIndex = 0,
Caption = "Year of first sale"
};
yearOfFirstSale.DataBinding = new ExpressionDataBinding()
{
Expression = "Aggr(Min(GetYear([OrderDate])), [Country])"
};
yearOfFirstSale.Options.ShowTotals = false;
pivotGridControl.Fields.Add(yearOfFirstSale);
Inheritance
Object
DataBindingBase
ExpressionBindingBase
ExpressionDataBinding
See Also