Skip to main content

PivotGridFieldBase.ExpressionFieldName Property

Gets the field’s name in unbound expressions.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v22.2.Core.dll

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Dashboard.Design


public string ExpressionFieldName { get; }

Property Value

Type Description

A String representing the field’s name in unbound expressions.



This member is not supported in Optimized, OLAP, and Server modes. Use ExpressionDataBinding/OlAPExpressionBinding instead.

The examples below show how to create unbound fields in code and supply them with data using expressions. Note that the ExpressionFieldName property is utilized to use other fields within an expression.

  • Example 1

    The following code snippet demonstrates how to create an unbound field in code and supply this field with data using the PivotGridField.UnboundExpression property. In this example, full names are generated based on the first and last names stored in the underlying data source.

    using DevExpress.XtraPivotGrid;
    public Form1() {
        // ... 
                PivotGridField fieldFullName = new PivotGridField() { Caption = "Full Name", Area = PivotArea.RowArea };
                fieldFullName.UnboundFieldName = "fieldFullName";
                fieldFullName.UnboundType = DevExpress.Data.UnboundColumnType.String;
                fieldFullName.UnboundExpression = 
                    "[" + fieldFirstName1.ExpressionFieldName + "]" + 
                    "+" + "' '" + "+" +
                    "[" + fieldLastName1.ExpressionFieldName + "]";
  • Example 2

    The following code snippet demonstrates how to create an unbound field in code and use the PivotGridField.UnboundExpression property to supply data. In this example, extended price values are calculated as follows:

    [Quantity] * [UnitPrice] * (1 - [Discount]).

    Pivot Grid field names are obtained using the PivotGridFieldBase.ExpressionFieldName property.

    PivotGridField fieldExtendedPrice = new PivotGridField() { Caption = "Extended Price", Area = PivotArea.DataArea };
    fieldExtendedPrice.UnboundFieldName = "fieldExtendedPrice";
    fieldExtendedPrice.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
    fieldExtendedPrice.UnboundExpression = string.Format("[{0}] * [{1}] * (1 - [{2}])", 
        fieldQuantity.ExpressionFieldName, fieldUnitPrice.ExpressionFieldName, fieldDiscount.ExpressionFieldName);

The following code snippets (auto-collected from DevExpress Examples) contain references to the ExpressionFieldName property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also