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 highlight busy days in DayPilot Navigator (ASP.NET WebForms)

How to highlight busy days in DayPilot Navigator (ASP.NET WebForms)

Last revision: Mar 21, 2013

Working examples can be found here:

1. It is necessary to set DataSource and call DataBind() in the Page_Load/!IsPostBack section:

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
  {
    DayPilotNavigator1.DataSource = getEvents();
    DataBind();
  }
}

getData() returns you data set. It can be the same data source you use for the main control(s). You will want to limit the getEvents() query using DayPilotNavigator.VisibleStart and DayPilotNavigator.VisibleEnd.

3. Don't forget to set DataStartField and DataEndField (in .aspx or in code behind):

DataStartField="start"
DataEndField="end" 

These properties will hold the names of the appropriate fields in your data source.

3. It is also necessary to handle DayPilotNavigator.VisibleRangeChanged event (which is fired when the user changes the visible range by clicking next/previous links):

protected void DayPilotNavigator1_VisibleRangeChanged(object sender, EventArgs e)
{
  DayPilotNavigator1.DataSource = getEvents();
  DayPilotNavigator1.DataBind();
}

4. Check that the theme contains a definition for _busy class if you are using CssOnly mode. Example from navigator_green.css:

.navigator_green_busy {
  font-weight: bold;
}

Related

How to upgrade from DayPilot Lite 3.0 to 3.1 [open-source]
How to show calendar events with custom background color in DayPilot Lite [open-source]
How to show the selected date using a Label control
Events show HTML source during image export (PNG)