DayPilot Knowledge Base

AJAX Calendar/Scheduling Controls
DayPilot Pro (AJAX Calendar Control)
» DayPilot ASP.NET Calendar
DayPilot Pro (AJAX Monthly Calendar Control)
» DayPilot ASP.NET Monthly Calendar
DayPilot Pro (AJAX Scheduler Control)
» DayPilot ASP.NET Scheduler
DayPilot » Knowledge Base » How to prevent event overlapping

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.

Server Side

  1. 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.
  2. You can use the following SQL select to check the new date: Testing for Overlapping Events with SQL
  3. 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.

Related

Events not showing up in the Scheduler
DayPilot Calendar control doesn't show any events
How to set the time cell colors using database data in the Scheduler
How to copy events using drag&drop (Ctrl key)