Back to Devexpress

PivotGridFieldOptionsEx.ShowExpressionEditorMenu Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldoptionsex-8bd39fa2.md

latest5.4 KB
Original Source

PivotGridFieldOptionsEx.ShowExpressionEditorMenu Property

Gets or sets whether a user can open the Expression Editor dialog for the current field in the context menu.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
[DefaultValue(false)]
public virtual bool ShowExpressionEditorMenu { get; set; }
vb
<DefaultValue(False)>
Public Overridable Property ShowExpressionEditorMenu As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if a user can open the Expression Editor dialog for the current field in a context menu; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowExpressionEditorMenu
PivotGridField

.Options .ShowExpressionEditorMenu

|

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 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.

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

Note

You cannot use the Expression Editor dialog in OLAP mode.

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

Note

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.

winforms-pivot-grid-custom-group-intervals/CS/CustomGroupIntervals/Form1.cs#L32

csharp
pivotGridFieldGroups.Caption = "Product Groups";
pivotGridFieldGroups.Options.ShowExpressionEditorMenu = true;
ExpressionDataBinding customInterval = new ExpressionDataBinding("Iif(Substring([fieldProductName], 0, 1) < 'F'," +

winforms-pivot-grid-custom-aggregates/CS/Win_Pivot_CustomAggregates/Form1.cs#L24

csharp
Expression = "FirstValue([ProductName])" };
pivotGridField1.Options.ShowExpressionEditorMenu = true;
pivotGridField1.Options.ShowGrandTotal = false;

winforms-pivot-grid-custom-group-intervals/VB/CustomGroupIntervals/Form1.vb#L31

vb
pivotGridFieldGroups.Caption = "Product Groups"
pivotGridFieldGroups.Options.ShowExpressionEditorMenu = True
Dim customInterval As ExpressionDataBinding = New ExpressionDataBinding("Iif(Substring([fieldProductName], 0, 1) < 'F'," & " 'A-E', Substring([fieldProductName], 0, 1) < 'T', 'F-S', 'T-Z')")

winforms-pivot-grid-custom-aggregates/VB/Win_Pivot_CustomAggregates/Form1.vb#L24

vb
pivotGridField1.DataBinding = New ExpressionDataBinding() With {.Expression = "FirstValue([ProductName])"}
pivotGridField1.Options.ShowExpressionEditorMenu = True
pivotGridField1.Options.ShowGrandTotal = False

See Also

PivotGridFieldOptionsEx Class

PivotGridFieldOptionsEx Members

DevExpress.XtraPivotGrid Namespace