New to Telerik UI for Blazor? Start a free 30-day trial

DatAInsightsComposer State

Updated on Nov 2, 2026

The Telerik DatAInsightsComposer for Blazor exposes state management capabilities through methods. Use them to get, save, and programmatically manipulate the DatAInsightsComposer state, including the configuration of already generated components.

Objects

The DatAInsightsComposer stores its state in the following objects:

Methods

The GetState and SetState methods of the DatAInsightsComposer instance let you obtain or update the current DatAInsightsComposer state on demand at any time in or after OnAfterRenderAsync.

To make changes to the DatAInsightsComposer state:

  1. Get the current state with the GetState method.
  2. Apply the desired modifications to the obtained DatAInsightsComposerState object.
  3. Set the modified state object through the SetState method.

To reset the DatAInsightsComposer state, call the SetState method and pass a new DatAInsightsComposerState instance as an argument.

Example

The following example demonstrates how to:

  • Modify the Prompt and Grid Height through the DatAInsightsComposer state. Setting the Prompt in the state fires PromptChanged, so that the app also updates the parameter value. Alternatively, you can directly set the DatAInsightsComposer Prompt parameter.
  • Reset the DatAInsightsComposer state and remove any generated components and history items.

Reset or modify the DatAInsightsComposer state

RAZOR
<TelerikButton OnClick="@UpdateDAICState">Update DAIC State</TelerikButton>
<TelerikButton OnClick="@ResetDAICState">Reset DAIC State</TelerikButton>

<TelerikDatAInsightsComposer @ref="@DAICRef"
                             @bind-Prompt="@DAICPrompt" />

@code {
    private TelerikDatAInsightsComposer? DAICRef;

    private string DAICPrompt { get; set; } = string.Empty;

    private async Task UpdateDAICState()
    {
        if (DAICRef is null)
        {
            return;
        }

        DatAInsightsComposerState daicState = DAICRef.GetState();

        daicState.Prompt = "New programmatic prompt";
        GridComponentConfig? gridConfig = daicState.Components.FirstOrDefault(x => x.ComponentConfig?.ComponentType == ComponentType.Grid)?.ComponentConfig as GridComponentConfig;

        if (gridConfig is not null)
        {
            gridConfig.Config.PageSize = 5;
            gridConfig.Config.Height = "auto";
        }

        await DAICRef.SetStateAsync(daicState);
    }

    private async Task ResetDAICState()
    {
        if (DAICRef is null)
        {
            return;
        }

        DatAInsightsComposerState newDAICState = new DatAInsightsComposerState();

        await DAICRef.SetStateAsync(newDAICState);
    }
}

Next Steps

See Also