wpf-7379-common-concepts-expressions-expression-editor-customization.md
You can customize the Expression Editor. For example, the image below shows the expression editor with the following changes:
Perform the following steps to customize the expression editor:
Handle the DataViewBase.UnboundExpressionEditorCreated (or PivotGridControl.UnboundExpressionEditorCreated) event.
Use one of the following properties to obtain the expression editor:
Specify the required expression editor’s properties.
The following code sample demonstrates how to customize the AutoComplete expression editor as shown in the image above:
<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";
}
}
See Also