DayPilot Knowledge Base

AJAX Calendar/Scheduling Controls
DayPilot Pro (AJAX Calendar Control)
» DayPilot AJAX Calendar
DayPilot Pro (AJAX Monthly Calendar Control)
» DayPilot AJAX Monthly Calendar
DayPilot Pro (AJAX Scheduler Control)
» DayPilot AJAX 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

Event Calendar for jQuery (ASP.NET MVC)
How to set the time cell colors using database data in the Scheduler
How to implement Copy & Paste in the Calendar
Events not showing up in the Scheduler