From 78dbf69c282255ca30b07a5c1c88d6cbdf485f93 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:15:40 +0300 Subject: [PATCH 01/14] docs(Grid): Add documentation about AI features --- .../smart-ai-features/ai-column-assistant.md | 138 ++++++++++++++++++ components/grid/smart-ai-features/overview.md | 123 ++++++++++++++++ components/grid/toolbar.md | 1 + docs-builder.yml | 3 + 4 files changed, 265 insertions(+) create mode 100644 components/grid/smart-ai-features/ai-column-assistant.md create mode 100644 components/grid/smart-ai-features/overview.md diff --git a/components/grid/smart-ai-features/ai-column-assistant.md b/components/grid/smart-ai-features/ai-column-assistant.md new file mode 100644 index 0000000000..57b00c6510 --- /dev/null +++ b/components/grid/smart-ai-features/ai-column-assistant.md @@ -0,0 +1,138 @@ +--- +title: AI Column Assistant +page_title: Grid - AI Column Assistant +description: Learn how to use the Telerik Grid for Blazor together with an InlineAIPrompt component to generate AI content and update the Grid data items. +slug: grid-ai-column +tags: telerik,blazor,grid,ai +published: True +position: 30 +--- + +# Grid AI Column Assistant + +This article shows how to integrate the Grid with the Inline AI Prompt component in order to allow users to use AI with regard to a specific Grid data item. Depending on the business requirements, the AI model can analyze the Grid data item and suggest additions or modifications. + +The suggested algorithm for implementation is the following: + +1. [Configure an InlineAIPrompt component that receives and provides the user prompt](#define-inlineaiprompt-component). +1. [Add a Grid column with a button that displays the InlineAIPrompt component](#add-grid-column-with-button). +1. (optional) [Implement an additional property of the Grid model class for AI content](#add-grid-column-for-ai-content). +1. [Update the Grid data or perform another action, based on the AI response](#update-grid-data). + +## Define InlineAIPrompt Component + +Follow the [InlineAIPrompt component documentation](slug:inlineaiprompt-overview) to configure an Inline AI Prompt component. Users can type an arbitrary prompt or optionally, pick from a predefined list of suggestions. + +````RAZOR.skip-repl + + +@code { + private TelerikInlineAIPrompt? InlineAIPromptRef { get; set; } + + private string UserPrompt { get; set; } = string.Empty; + + // List optional predefined prompt suggestions. + private List PredefinedPromptSuggestions { get; set; } = new(); + + // Define possible actions over the AI response. + private List ActionsOverAIResponse { get; set; } = new(); + + private void OnPredefinedPromptSuggestionSelect(InlineAIPromptCommandExecuteEventArgs args) + { + // This handler executes when the user selects a predefined prompt. + + Prompt = args.Command.Prompt; + } + + private async Task SendAIRequestAndGetResponse(InlineAIPromptPromptRequestEventArgs args) + { + // This handler executes when the user submits their AI prompt. + // Set the AI service response to args.Output. + + args.Output = "The AI response to the user prompt."; + } + + private async Task OnAIResponseActionClick(InlineAIPromptOutputActionClickEventArgs args) + { + // This handler executes when the user clicks on an action from ActionsOverAIResponse. + // You can modify the Grid data source here. + } +} +```` + +## Add Grid Column with Button + +Add a Grid column with no `Field`. The column must have a `