New to Telerik UI for BlazorStart a free 30-day trial

Chat Events

Updated on Aug 31, 2026

The Telerik UI for Blazor Chat component exposes various events that allow you to implement custom functionality and handle user interactions. This article lists the available events and provides examples for the most common use cases.

OnSendMessage

The OnSendMessage event fires when a user sends a new message. Use this event to handle message processing, validation, and persistence.

After the event handler executes, the Chat automatically scrolls down to the last message.

Handle the Chat OnSendMessage event

Example
View Source
Loading ...

OnResendMessage

The OnResendMessage event fires when a user clicks the resend button of a failed message. Use this event to handle error message retry.

Handle the Chat OnResendMessage event

Example
View Source
Loading ...

OnSuggestionClick

The OnSuggestionClick event fires when a user clicks on a quick reply suggestion. You can use this event to customize suggestion handling.

If the handler adds new messages to the Chat, call the component Refresh() method to scroll down to the last message.

Handle Chat suggestion clicks

Example
View Source
Loading ...

OnDownload

The OnDownload event fires when a user downloads files from a message. Use this event to handle file access, logging, or custom download logic.

Handle Chat file downloads

RAZOR
<TelerikChat Data="@ChatData"
             OnDownload="@OnChatDownload">
</TelerikChat>

@code {  
    private async Task OnChatDownload(ChatDownloadEventArgs args)
    {
        foreach (FileSelectFileInfo file in args.Files)
        {
            // Implement custom download logic
        }
    }
}

OnMessageUnpin

The OnMessageUnpin event fires when a user unpins a message. Handle this event to update your data model and persist the change.

Handle Chat message unpinning

RAZOR
<TelerikChat Data="@ChatData"
             OnMessageUnpin="@OnChatMessageUnpin">
</TelerikChat>

@code {
    private List<Message> ChatData { get; set; } = new();

    private void OnChatMessageUnpin(ChatMessageUnpinEventArgs args)
    {
        var message = ChatData.First(m => m.Id == args.MessageId);

        message.IsPinned = false;
    }
}

OnInputValueChanged

The OnInputValueChanged event fires when the input value changes. Use this for real-time validation, auto-save drafts, or typing indicators.

Handle Chat input value changes

RAZOR
<TelerikChat Data="@ChatData"
             InputValue="@ChatInputValue"
             OnInputValueChanged="@OnChatInputValueChanged">
</TelerikChat>

@code {
    private List<Message> ChatData { get; set; } = new();

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

    private void OnChatInputValueChanged(string newValue)
    {
        ChatInputValue = newValue;
    }
}

Event Arguments

The Chat events provide specific argument types with relevant data:

EventArguments TypeKey Properties
OnSendMessageChatSendMessageEventArgsMessage, Files, ReplyMessageId
OnResendMessageChatResendMessageEventArgsMessageId
OnSuggestionClickChatSuggestionClickEventArgsSuggestion, IsCancelled
OnDownloadChatDownloadEventArgsFiles, MessageId
OnMessageUnpinChatMessageUnpinEventArgsMessageId
OnInputValueChangedstringThe current input value
OnLoadMoreMessagesChatLoadMoreMessagesEventArgsStartIndex, EndIndex
OnReferencedMessageClickChatReferencedMessageClickEventArgsId

See Also