search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to make data refresh when selecting different week on Navigator?

Asked by Anonymous
5 years ago.

I have DayPilot Calendar and Navigator. I've successfully linked the navigator to the calendar so when i click on different weeks, the weeks change in the Calendar too.

Problem is, my data is gone when I click on a different week.

How do I make it so that when I click on a different week, my data from the database is still there?

Answer posted by Dan Letecky [DayPilot]
5 years ago.

You need to reload the data source in Command event handler (where you change the dates according to the selected date received from the Navigator).

protected void DayPilotScheduler1_Command(object sender, CommandEventArgs e)
{
  switch (e.Command)
  {
      case "navigate":
          DayPilotCalendar1.StartDate = (DateTime)e.Data["day"];
          DayPilotCalendar1.DataSource = GetData(DayPilotCalendar1.StartDate, DayPilotCalendar1.EndDate.AddDays(1));
          DayPilotCalendar1.DataBind();
          DayPilotCalendar1.Update();
          break;
      // ...
  }
}

See also:
http://doc.daypilot.org/calendar/navigator/

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.