AppointmentSelectionBehavior
In RadScheduler there are plugin selection behaviors that make it possible to customize the logic behind all selections in the control. There are selection behaviors like AppointmentSelectionBehavior, SlotSelectionBehavior etc.
AppointmentSelectionBehavior is responsible for executing the selection logic of appointments in the control. Its default behavior is for single, multiple and extended selection. It is possible to customize the behavior in order to restrict selecting appointments in different resources, selecting more than one appointment etc.
Disable multiple appointments selection based on ResourceName
This tutorial will go through on how to create a custom AppointmentSelectionBehavior in the scenario when there are different resources in the Scheduler control and it is required to disable simultaneous selection of appointments in different resource groups.
Before proceeding with this tutorial first read about Resources in RadScheduler.
- Create CustomAppointmentSelectionBehavior class that inherits AppointmentSelectionBehavior class:
Example 1
- Override the GetSelectedAppointments method:
Example 2
- All that is left is to attach the newly created custom behavior to the Scheduler: