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 make the Calendar events read-only

How to make the Calendar events read-only

Last revision: Feb 18, 2010

You can make individual events read-only by handling BeforeEventRender event handler.

You can override the default settings by changing the value of the following BeforeEventRenderEventArgs properties:


     protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
        if (e.Tag["readonly"] == "true")
            e.EventClickEnabled = false;
            e.EventDeleteEnabled = false;
            e.EventMoveEnabled = false;
            e.EventResizeEnabled = false;
            e.EventRightClickEnabled = false;

This example assumes that you have stored a custom DataSource field indicating the read-only status in Tag using DataTagFields:



How to use DayPilot controls with custom database structure (schema)
DayPilot and ViewState
How to show event-specific context menu
How to show one month per cell in Scheduler (CellDuration = Month)