Skip to main content

DataViewBase.ShowUnboundExpressionEditor(ColumnBase) Method

Invokes the Expression Editor that enables editing an expression for the specified unbound column.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public virtual void ShowUnboundExpressionEditor(
    ColumnBase column
)

Parameters

Name Type Description
column ColumnBase

A ColumnBase descendant that specifies the unbound column.

Remarks

Data for Unbound Columns can be provided within the GridControl.CustomUnboundColumnData event handler, or by specifying an expression via the ColumnBase.UnboundExpression property. At runtime, an end-user can edit expressions for unbound columns using the Expression Editor.

The DataViewBase.UnboundExpressionEditorCreated event fires in response to creating the expression editor, allowing you to prevent the editor from being displayed, customize its settings, etc.

Call the ShowUnboundExpressionEditor method to invoke the expression editor in code:

gridControl.View.ShowUnboundExpressionEditor(gridControl.Columns["DiscountAmount"]);

The code sample below demonstrates how to create a button that allows invoking the expression editor:

<dxg:GridControl Name="gridControl">
   <dxg:GridControl.Columns>
      <!---->
      <dxg:GridColumn FieldName="DiscountAmount" />
   </dxg:GridControl.Columns>
   <dxg:TableView Name="view" />
</dxg:GridControl>

<Button Command="{Binding Commands.ShowUnboundExpressionEditor, ElementName=view}" 
   CommandParameter="DiscountAmount">Show Expression Editor</Button>

End-users can invoke the expression editor using a column’s context menu if the ColumnBase.AllowUnboundExpressionEditor option is enabled. See the Invoking Expression Editor topic to learn more.

See Also