New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Chat for ASP.NET MVC events.

Definition

Constructors

Initializes a new instance of the ChatEventBuilder class.

C#
public ChatEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

The Chat event handlers.

Methods

Defines the handler of the ContextMenuAction client-side event. Fired when a message context menu action is executed. This event allows you to handle custom message actions and respond to user interactions with message context menus.

C#
public ChatEventBuilder ContextMenuAction(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ContextMenuAction client-side event. Fired when a message context menu action is executed. This event allows you to handle custom message actions and respond to user interactions with message context menus.

C#
public ChatEventBuilder ContextMenuAction(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ContextMenuAction event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Download client-side event. Fired when a download action is triggered, either from the "Download All" button or from a file menu download action.

C#
public ChatEventBuilder Download(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Download client-side event. Fired when a download action is triggered, either from the "Download All" button or from a file menu download action.

C#
public ChatEventBuilder Download(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Download event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ExecuteAction client-side event. Fired when the user clicks an action button in an attachment card. Use this event to handle custom actions defined in attachment data.

C#
public ChatEventBuilder ExecuteAction(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ExecuteAction client-side event. Fired when the user clicks an action button in an attachment card. Use this event to handle custom actions defined in attachment data.

C#
public ChatEventBuilder ExecuteAction(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ExecuteAction event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileMenuAction client-side event. Fired when a file context menu action is executed. This event allows you to handle custom file actions and respond to user interactions with file attachments.

C#
public ChatEventBuilder FileMenuAction(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileMenuAction client-side event. Fired when a file context menu action is executed. This event allows you to handle custom file actions and respond to user interactions with file attachments.

C#
public ChatEventBuilder FileMenuAction(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the FileMenuAction event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileRemove client-side event. Fired when the user removes a file attachment.

C#
public ChatEventBuilder FileRemove(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileRemove client-side event. Fired when the user removes a file attachment.

C#
public ChatEventBuilder FileRemove(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the FileRemove event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileSelect client-side event. Fired when the user selects files using the file attachment button.

C#
public ChatEventBuilder FileSelect(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the FileSelect client-side event. Fired when the user selects files using the file attachment button.

C#
public ChatEventBuilder FileSelect(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the FileSelect event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Input client-side event. Fired when the user types in the message input field.

C#
public ChatEventBuilder Input(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Input client-side event. Fired when the user types in the message input field.

C#
public ChatEventBuilder Input(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Input event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ReferencedMessageClick client-side event. Fired when the user clicks a pinned message banner or a reply reference.The event payload contains only { id } for both pinned-banner clicks and reply-reference clicks.In endless scrolling mode, the event fires before the Chat attempts to render and scroll to a referenced message that is outside the current batch.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ChatEventBuilder ReferencedMessageClick(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ReferencedMessageClick client-side event. Fired when the user clicks a pinned message banner or a reply reference.The event payload contains only { id } for both pinned-banner clicks and reply-reference clicks.In endless scrolling mode, the event fires before the Chat attempts to render and scroll to a referenced message that is outside the current batch.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ChatEventBuilder ReferencedMessageClick(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ReferencedMessageClick event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ResendMessage client-side event. Fired when the user clicks the retry button on a failed message. Use this event to re-attempt message delivery.

C#
public ChatEventBuilder ResendMessage(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ResendMessage client-side event. Fired when the user clicks the retry button on a failed message. Use this event to re-attempt message delivery.

C#
public ChatEventBuilder ResendMessage(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ResendMessage event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the SendMessage client-side event. Fired when the user clicks the action button (send or stop). This is the primary event for handling message submission and stop generation requests.The postMessage method do not trigger this event.

C#
public ChatEventBuilder SendMessage(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the SendMessage client-side event. Fired when the user clicks the action button (send or stop). This is the primary event for handling message submission and stop generation requests.The postMessage method do not trigger this event.

C#
public ChatEventBuilder SendMessage(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the SendMessage event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the SuggestionClick client-side event. Fired when a user clicks a suggestion in the Chat. Global suggestions always trigger this event. Per-message suggestedActions trigger this event when suggestionsBehavior is set to "insert"; otherwise they flow through sendMessage.

C#
public ChatEventBuilder SuggestionClick(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the SuggestionClick client-side event. Fired when a user clicks a suggestion in the Chat. Global suggestions always trigger this event. Per-message suggestedActions trigger this event when suggestionsBehavior is set to "insert"; otherwise they flow through sendMessage.

C#
public ChatEventBuilder SuggestionClick(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the SuggestionClick event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ToolbarAction client-side event. Fired when a toolbar action is executed on a message. This event allows you to handle custom toolbar actions and respond to user interactions with message controls.

C#
public ChatEventBuilder ToolbarAction(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the ToolbarAction client-side event. Fired when a toolbar action is executed on a message. This event allows you to handle custom toolbar actions and respond to user interactions with message controls.

C#
public ChatEventBuilder ToolbarAction(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the ToolbarAction event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Unpin client-side event. Fired when a pinned message is unpinned. This event is triggered when a user clicks the close (X) button on a pinned message.

C#
public ChatEventBuilder Unpin(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .

Defines the handler of the Unpin client-side event. Fired when a pinned message is unpinned. This event is triggered when a user clicks the close (X) button on a pinned message.

C#
public ChatEventBuilder Unpin(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Unpin event.

Returns:

ChatEventBuilder

Returns the current instance of ChatEventBuilder .