ButtonGroup Events
This article describes the events of the Telerik ButtonGroup component for Blazor.
OnClick
The OnClick event fires when the user clicks or taps a button. You can use it to invoke async logic such as fetching data or calling a service.
The OnClick event argument is of type MouseEventArgs.
OnClick always fires before the Selected values of related buttons change.
Handle the Button OnClick event in a ButtonGroup
The event is an
EventCallback. It can be synchronous and returnvoid, or asynchronous and returnasync Task. Do not useasync void.
SelectedChanged
The SelectedChanged fires when the user changes the selected state of a button via click, tap, Space key or Enter key. You can use it to call local view-model logic. To fetch data or perform async operations, use the OnClick event.
This event is available only for ButtonGroupToggleButton instances.
When the SelectionMode is Single, then SelectedChanged fires first for the previously selected button, and then for the newly selected button.
Normally, the SelectedChanged handler should update the Selected value of the respective button. If you choose not to do that, this will effectively cancel the event.
Handle the SelectedChanged event