The option #1 is already available. Beyond coloring the forbidden areas you would need to do the following (schematically) in the TimeRangeSelected handler:
if (allowed) {
createANewEventInTheDB(start, end);
DayPilotScheduler1.DataBind();
DayPilotScheduler1.Update();
}
else {
Hashtable response = new Hashtable();
response["status"] = "not-allowed";
response["message"] = "It's not allowed to create a new event in this area";
DayPilotScheduler1.Update(response);
}
Then use the following JavaScript handler for AfterRenderJavaScript:
function afterRender(data) {
if (data) {
if (data.status == 'not-allowed') {
showMessage(data.message);
}
}
}
I've used a Hashtable in the example to demonstrate that you can send a structure back instead of a simple string.
Could that work for you?