DataViewBase.UnboundExpressionEditorCreated Event
Fires after the Expression Editor has been invoked for an unbound column.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
#Declaration
public event UnboundExpressionEditorEventHandler UnboundExpressionEditorCreated
#Event Data
The UnboundExpressionEditorCreated event's data class is UnboundExpressionEditorEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Auto |
Gets the Expression Editor in Auto |
Column |
Gets the column for which the expression editor is invoked.
Inherited from Expression |
Expression |
Gets or sets the expression that is passed to the Expression Editor on its initialization.
Inherited from Expression |
Expression |
Gets the Expression Editor in Standard mode.
Inherited from Expression |
Expression |
Gets or sets the expression editor’s mode.
Inherited from Expression |
Handled |
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
Inherited from Routed |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Source | Gets the View that raised the event. |
The event data class exposes the following methods:
Method | Description |
---|---|
Invoke |
When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.
Inherited from Routed |
On |
When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.
Inherited from Routed |
#Remarks
The UnboundExpressionEditorCreated event fires after the Expression Editor has been created, before it’s displayed. Handle this event to prevent the editor from being displayed or customize its settings.
The following code sample demonstrates how to customize the expression editor:
<dxg:GridControl>
<!---->
<dxg:GridControl.View>
<dxg:TableView UnboundExpressionEditorCreated="OnUnboundExpressionEditorCreated" />
</dxg:GridControl.View>
</dxg:GridControl>
void OnUnboundExpressionEditorCreated(object sender, UnboundExpressionEditorEventArgs e) {
var expressionEditorContext = e.AutoCompleteExpressionEditorControl.Context;
var nowFunction = expressionEditorContext.Functions.FirstOrDefault(f => string.Equals(f.Name, "now", StringComparison.OrdinalIgnoreCase));
if (nowFunction != null) {
expressionEditorContext.Functions.Remove(nowFunction);
}
foreach (var columnInfo in expressionEditorContext.Columns) {
columnInfo.Category = "Fields";
}
}