Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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