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

Expression Editor Customization

You can customize the Expression Editor. For example, the image below shows the expression editor with the following changes:

  • The Columns category is renamed to Fields.
  • The Now function is removed from the date-time functions list.

ExpressionEditorCustomization

Perform the following steps to customize the expression editor:

  1. Handle the DataViewBase.UnboundExpressionEditorCreated (or PivotGridControl.UnboundExpressionEditorCreated) event.
  2. Use one of the following properties to obtain the expression editor:

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