Skip to main content
A newer version of this page is available. .

ExpressionDataBinding Class

Defines a calculation based on a string expression.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.2.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public class ExpressionDataBinding :
    ExpressionBindingBase

Remarks

To bind a PivotGrid field to the result of the calculation, do the following:

  1. Create an instance of the ExpressionDataBinding class.
  2. Specify the expression.
  3. Assign the ExpressionDataBinding instance to the PivotGridField.DataBinding property.

Example

The following code snippet illustrates the use of the Data Binding API:

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

See Also