Disable Multiple Appointments Selection in RadScheduleView
Environment
Product Version | 2019.3.917 |
Product | RadScheduleView for WPF |
Description
Disable multiple appointments selection in RadScheduleView using a custom AppointmentSelectionBehavior.
Solution
To allow only a single appointment to be selected you can create a custom AppointmentSelectionBehavior and override its GetSelectedAppointments method.
public class CustomAppointmentSelectionBehavior : AppointmentSelectionBehavior
{
protected override IEnumerable<IOccurrence> GetSelectedAppointments(AppointmentSelectionState state, IOccurrence target)
{
var originalSelection = base.GetSelectedAppointments(state, target);
if (originalSelection.Count() > 1)
{
var lastSelected = originalSelection.Last();
return new List<IOccurrence>() { lastSelected };
}
return originalSelection;
}
}