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 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 open a new event dialog using TimeRangeSelected event (modal.js)
Event Calendar for jQuery (ASP.NET MVC)
How to show event details in a modal dialog (modal.js)
How to set the time cell colors using database data in the Scheduler