Skip to main content
All docs
V25.2
  • PromptToExpressionBehavior Class

    Converts natural language into valid filter and unbound column expressions for data-aware WinForms controls.

    Namespace: DevExpress.AIIntegration.WinForms

    Assembly: DevExpress.AIIntegration.WinForms.v25.2.dll

    NuGet Package: DevExpress.AIIntegration.WinForms

    Declaration

    public sealed class PromptToExpressionBehavior :
        Behavior<IPromptToExpressionBehaviorSource>,
        IAIExpressionEditorCustomization

    Remarks

    Prompt to Expression converts natural language into valid filter and unbound column expressions for data-aware WinForms controls. Instead of writing complex expressions, users describe the desired logic in plain text. The system sends the prompt to the configured AI service, which generates a valid expression for the control. The Expression Editor or Filter Editor immediately displays and validates the result immediately.

    Prompt to Expression - WinForms UI Controls, DevExpress

    Run Demo: Prompt to Expression

    To attach the Prompt to Expression Behavior to a control, do the following:

    1. Install AI-related NuGet packages and register an AI client.
    2. Drop the BehaviorManager component from the Toolbox onto a Form.
    3. Add a PromptToExpressionBehavior, configure its settings, and attach the behavior to a DevExpress UI control (GridControl, VGridControl, or TreeList). You can do this at design time or in code:

      Prompt to Expression Behavior, DevExpress

      using DevExpress.AIIntegration.WinForms;
      
      public Form1() {
          InitializeComponent();
      
          behaviorManager1.Attach<PromptToExpressionBehavior>(gridView1, behavior =>
          {
              behavior.Properties.RetryAttemptCount = 3;
              behavior.Properties.Temperature = 0.3;
          });
      }
      

    See the following help topic for more information: Prompt to Expression.

    Inheritance

    Object
    DevExpress.Utils.MVVM.BehaviorBase
    DevExpress.Utils.Behaviors.Behavior
    DevExpress.Utils.Behaviors.Behavior<DevExpress.AIIntegration.WinForms.IPromptToExpressionBehaviorSource>
    PromptToExpressionBehavior
    See Also