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 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:

Example

     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:

DataTagFields="readonly"

Related

Context menu uses no styling (only gray background)
How to use clientState property
How to show one month per cell in Scheduler (CellDuration = Month)
How to compile DayPilot Pro source (ASP.NET WebForms)