html5 event calendar disabled cells

You can mark selected grid cells as disabled and forbid them as a target for drag and drop operations (time range selectingevent movingevent resizing). To mark cells as disabled, use BeforeCellRender event (see also cell customization).

JavaScript

Available since 2019.1.3538.

Example

dp.onBeforeCellRender = function(args) {
  if (args.cell.start.getDatePart() <= DayPilot.Date.today()) {
      args.cell.disabled = true;
      args.cell.backColor = "#eee";
  }
};

Tutorial

Demo

ASP.NET WebForms

Available since 2019.1.3695.

Example

protected void DayPilotCalendar1_BeforeCellRender(object sender, BeforeCellRenderEventArgs e)
{
    if (e.Start < DateTime.Today.AddHours(12))
    {
        e.Disabled = true;
        e.BackgroundColor = "#ccc";
    }
}

ASP.NET MVC

Available since 2019.1.5964.

Example

protected override void OnBeforeCellRender(BeforeCellRenderArgs e)
{
  if (e.Start < DateTime.Today.AddHours(12))
  {
    e.Disabled = true;
    e.BackgroundColor = "#eee";
  }
}

Demo