New to Telerik UI for Blazor? Download Free 30-day trial
Scheduler - Events
- EXAMPLE
- VIEW SOURCE
- EDIT IN TELERIK REPL
- Change Theme
default
- Events.razor
- AppointmentService.cs
- AppointmentDto.cs
Description
Telerik UI for Blazor Scheduler exposes various events that let you respond to the user actions.
CUD events target the appointment editing. The Blazor Scheduler fires OnCreate,
OnUpdate and
OnDelete events for the corresponding user action – create, update and delete appointments. You can handle them to update the actual data source. Test the implementation of the CUD events in the Appointment Editing demo.
In some scenarios, you may need to bind the component to an abstract class, interface or a class that has no parameterless constructor. If so, handle the OnModelInit which fires before editing and adding new item in the component.
Click and double click on items are common user actions that the Blazor Scheduler listens to. Handle the OnItemClick
or OnItemDoubleClick
when you want to perform some logic upon appointment click or double click.
The Scheduler also catches a right click on an appointment to fire the OnItemContextMenu
event. It can be used for a ContextMenu integration to expose additional actions for the items.
The ItemRender
event of the Blazor Scheduler fires when the appointments are rendered. It allows you customize their appearance by adding a custom CSS class to their container.
The Scheduler component will also react when the user changes the current date through the Toolbar navigation options and when they switch to another view. Handle the DateChanged
or ViewChanged
if you want to react to these changes.
The current demo showcases handling of several Scheduler events and logging them in an EventLog. For example, the OnCellRender
event is used to add styles to the underlying slot cells and this demo highlights the weekends as well as the slots between 12 PM and 1 PM indicating a lunch break.