How to prevent event overlapping
Last revision: Feb 3, 2016
Real-Time Overlap Prevention (Client Side)
You can enable real-time overlap checking using AllowEventOverlap property.
- Typically, the check will need to be done in EventResize, EventMove. Depending on how you create the new events you might need to add it to TimeRangeSelected, TimeRangeMenuClick, TimeRangeDoubleClick, and Command.
- You can use the following SQL select to check the new date: Testing for Overlapping Events with SQL
- If the new/updated event doesn't meet the criteria, you should deny the action (don't update the DB) and notify the user using UpdateWithMessage(msg):
Event handler (.aspx.cs file):
DayPilotScheduler1.UpdateWithMessage("This action is not allowed (overlapping events)");
This technique is also demonstrated in the Hotel Room Booking Scheduler Tutorial.