This example adds an AI-powered Smart Paste command to our Grid and Layout controls. Our command is based on the official Embarcadero SmartCore AI Components Pack available in the GetIt Package Manager. VCL developers can switch between different AI service providers as requirements dictate.
A Smart Paste command analyzes clipboard content and assigns correct values (in specific formats) to corresponding editors in a complex UI layout or within grid cells.
- Embarcadero RAD Studio IDE 13 or newer (Community Edition is not supported)
- SmartCore AI Component Pack installed from GetIt
- DevExpress VCL Components v25.2.3 or newer
To connect this sample project to an AI service provider, you must:
- Open the main form in Designer mode.
- Select the OpenAI or Google Gemini provider component.
- Expand the
Paramsnode in the Object Inspector and paste a valid API key into theAPIKeyinput box. - Uncomment the
TdxSmartCoreAIChatClient.Createmethod call for the target AI provider:
procedure TSmartCoreAIDemoMainForm.FormCreate(Sender: TObject);
var
Client: TdxAIChatClient;
begin
// OpenAI
// Client := TdxSmartCoreAIChatClient.Create(OpenAIDriver);
// Google Gemini
// Client := TdxSmartCoreAIChatClient.Create(GeminiDriver);
TdxAIChatClients.AddChatClient(Client);
end;
Note
DevExpress AI-powered Extensions follow the "bring your own key" principle. DevExpress does not offer a REST API and does not ship any built-in LLMs/SLMs. You need an active subscription for the required AI service to obtain the REST API endpoint, key, and model deployment name. These variables must be specified at application startup to register AI clients and enable DevExpress AI-powered Extensions in your application.
- Run the sample project.
- Click the Copy Text button or copy text manually (you can edit text directly within the editor box if you wish).
- Click the AI-powered Smart Paste button to insert clipboard content into grouped editors.
- Switch to the Grid tab within the sample app.
- Copy any text line from the memo editor.
- Move focus to the target grid record or switch to Append mode.
- Right-click the grid's pop-up menu and select the Smart Paste option.
- AI-powered Smart Paste for Native VCL Controls
- TcxCustomGridTableView.SmartPaste
- TdxCustomLayoutGroup.SmartPaste
(you will be redirected to DevExpress.com to submit your response)

