windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-dot-showexpressioneditor-x28-devexpress-dot-xtrapivotgrid-dot-pivotgridfield-x29.md
Invokes the Expression Editor where a user can edit the specified field’s binding expression.
Namespace : DevExpress.XtraPivotGrid
Assembly : DevExpress.XtraPivotGrid.v25.2.dll
NuGet Package : DevExpress.Win.PivotGrid
public virtual bool ShowExpressionEditor(
PivotGridField field
)
Public Overridable Function ShowExpressionEditor(
field As PivotGridField
) As Boolean
| Name | Type | Description |
|---|---|---|
| field | PivotGridField |
A calculated field whose expression is edited in the Expression Editor.
|
| Type | Description |
|---|---|
| Boolean |
true if the OK button is pressed when a user closes the editor; otherwise, false.
|
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);
}
}
Private Sub pivotGridControl1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim info As PivotGridHitInfo = pivotGridControl1.CalcHitInfo(New Point(e.X, e.Y))
If info IsNot Nothing AndAlso info.HeaderField = pivotGridField2 Then
pivotGridControl1.ShowExpressionEditor(pivotGridField2)
End If
End Sub
Use the PivotGridOptionsBehavior.ExpressionEditorMode property to specify the Expression Editor’s version.
See Also