Events
This article explains the events available in the Telerik TimePicker for Blazor:
ValueChanged
The ValueChanged event fires upon every change (for example, keystroke) in the input, and upon clicking the Set or Now buttons in the dropdown.
The event handler receives the new value as an argument and you must update the component Value programmatically for the user changes to take effect.
Handle the TimePicker ValueChanged event
OnChange
The OnChange event represents a user action that confirms the current value. It fires when the user:
- Presses
Enterwhile the textbox is focused. - Clicks Set in the time selection popup.
- Blurs the component.
The event handler receives an object argument that you need to cast to the actual Value type. The argument can hold a value or be null, depending on the user input and the Value type.
The TimePicker is a generic component, so you must either provide a Value, or a type to the T parameter of the component.
Handle DateTimePicker OnChange and use two-way Value binding
The event is an
EventCallback. It can be synchronous and returnvoid, or asynchronous and returnasync Task. Do not useasync void.
The
OnChangeevent is a custom event and does not interfere with bindings, so you can use it together with models and forms.
OnOpen
The OnOpen event fires before the TimePicker popup renders.
The event handler receives as an argument an TimePickerOpenEventArgs object that contains:
| Property | Description |
|---|---|
IsCancelled | Set the IsCancelled property to true to cancel the opening of the popup. |
OnClose
The OnClose event fires before the TimePicker popup closes.
The event handler receives as an argument an TimePickerCloseEventArgs object that contains:
| Property | Description |
|---|---|
IsCancelled | Set the IsCancelled property to true to cancel the closing of the popup. |
OnBlur
The OnBlur event fires when the component loses focus.
Handle the OnBlur event