Navigator: Binding to DayPilot Controls

The Navigator control can be bound to a main DayPilot control (CalendarMonthScheduler) using BoundDayPilot property:

<%= Html.DayPilotNavigator("dpn", new DayPilotNavigatorConfig { 
  ...
  BoundDayPilot = "dpc"
})%>

If the BoundDayPilot propety is set, the Navigator will fire Command event on the bound control. The command name (e.Command) will be set to "navigate" (value of BindCommand property), and the selected range will be available in custom data (e.Data["start"] and e.Data["end"]):

protected override void OnCommand(CommandArgs e)
{
  switch (e.Command)
  {
    case "navigate":
      StartDate = (DateTime) e.Data["start"];
      Update(CallBackUpdateType.Full);
      break;
  }
}

protected override void OnFinish()
{
  // only load the data if an update was requested by an Update() call
  if (UpdateType == CallBackUpdateType.None)
  {
    return;
  }

  Events = new EventManager(Controller).Data.AsEnumerable();

  DataStartField = "start";
  DataEndField = "end";
  DataTextField = "text";
  DataIdField = "id";
}

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java