Skip to main content
All docs
V23.2

PivotGridControl.ShowExpressionEditor(PivotGridField) Method

Invokes the Expression Editor where a user can edit the specified field’s binding expression.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v23.2.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public virtual bool ShowExpressionEditor(
    PivotGridField field
)

Parameters

Name Type Description
field PivotGridField

A calculated field whose expression is edited in the Expression Editor.

Returns

Type Description
Boolean

true if the OK button is pressed when a user closes the editor; otherwise, false.

Remarks

Pivot Grid allows you to create calculated fields. They do not obtain their values from fields in the data source. Instead, you specify a binding expression. The expression can be a formula or an aggregate function. You can use the following classes to create a calculated field:

You can allow users to edit or create new custom expressions in the Expression Editor at runtime. To accomplish this, set the PivotGridFieldOptionsEx.ShowExpressionEditorMenu property to true to add the Expression Editor command to the field’s context menu or call the ShowExpressionEditor method to invoke the Expression Editor.

Note

You cannot use the Expression Editor dialog in OLAP mode.

The following code snippet shows how to invoke the Expression editor for pivotGridField2 on a mouse click:

private void pivotGridControl1_MouseClick(object sender, MouseEventArgs e) {
        PivotGridHitInfo info = pivotGridControl1.CalcHitInfo(new Point(e.X, e.Y));
        if (info != null && info.HeaderField == pivotGridField2) {
            pivotGridControl1.ShowExpressionEditor(pivotGridField2);
        }
    }

_EU_ExpressionEditorInvoking

Use the PivotGridOptionsBehavior.ExpressionEditorMode property to specify the Expression Editor’s version.

See Also