WinForms Inline AI Assistant Design Time
The Telerik UI for WinForms RadInlineAIAssistant component supports design-time configuration through the Visual Studio Properties window and its smart tag. Because it is nonvisual, it appears in the component tray below the form, not on the form surface.
Adding the Component
- Open the form in the Windows Forms Designer.
- Drag RadInlineAIAssistant from the Toolbox onto the designer. Select the resulting component in the component tray.
- Configure the component through its smart tag or the Properties window.
- Open the Events view in the Properties window and create a handler for
PromptRequest. Supply the response in this handler.
For text-box hosts, call AttachTo in code after InitializeComponent. AttachedControl is read-only and InteractionProvider is not exposed in the designer. For a RadRichTextEditor, select the editor and assign its InlineAIAssistant property to the component instead.
Adding the component does not connect it to an AI service. See Getting Started for host attachment, opening the popup, and response handling.
Smart Tag Options
The component-specific smart-tag actions are:
| Option | Description |
|---|---|
| Edit Commands | Opens the collection editor for the commands dropdown. |
| Prompt placeholder | Sets NullText, the text displayed when the prompt input is empty. |
| Close when another application is activated | Sets AutoCloseOnFocusLost. The default is true. |
Editing Commands
Select Edit Commands from the smart tag, or open the editor for Commands in the Properties window.
- Add an
InlineAIAssistantCommandfor a selectable prompt. SetTextto its display label andPromptto the instruction it submits. IfPromptis not set, the command uses itsText. - Add an
InlineAIAssistantCommandGroupto organize related prompts. Set the group'sTextand edit itsCommandscollection to add child commands. The designer supports one level of grouping: groups contain commands, not nested groups. - Set
Iconto display an image alongside a command or group. UseTagfor application-specific data.
For example, create a Tone group with Friendly and Formal commands. Set their prompts to instructions such as "Rewrite the selected text in a friendly tone." The application must send the prompt and relevant host text to its AI service; a command label alone does not implement that operation.
Handle CommandExecuting to change the prompt or cancel the command before PromptRequest is raised.
Configuring Popup Properties
Use the Properties window to set PopupWidth, ResponseMaxHeight, NullText, ThemeName, and the automatic closing options. PopupWidth defaults to 460 logical pixels, and ResponseMaxHeight defaults to 250 pixels.
OpeningEventName can name a public event on the attached host that opens the assistant. For conditional triggers, such as a keyboard shortcut, handle the event in code and call Show only when the condition is met.
The popup appears at runtime when Show is called or a configured opening event is raised. See Properties, Methods, and Events for the complete configuration reference.