ToggleButton Events
This article describes the events of the Telerik ToggleButton for Blazor:
The OnClick event fires before SelectedChanged.
OnClick
The OnClick event fires when the user clicks or taps the button, or presses Enter or Space while the button is focused. You can use the event to invoke async logic such as fetching data or calling a service.
The event handler receives argument of type MouseEventArgs.
The OnClick event fires before SelectedChanged. Do not change the Selected parameter value in the OnClick event if the OnClick handler is asynchronous. Control the Selected parameter value in the SelectedChanged event.
Handle the Toggle Button OnClick event
The event is an
EventCallback. It can be synchronous and returnvoid, or asynchronous and returnasync Task. Do not useasync void.
SelectedChanged
The SelectedChanged event fires when the user changes the button state by clicking, tapping, hitting Space or Enter. Use it to call local view-model logic. To fetch data or perform async operations, use the OnClick event.
The event handler receives a bool argument. Use it to update the Selected parameter value. If you don't do this, you will effectively cancel the event.
The SelectedChanged event fires after OnClick.
Handle the SelectedChanged event