1

I'm using DayPilot Calendar and Navigator on Visual Studios 2013, webform.

I am able to link the navigator to the calendar, so when I click on a different week, it reflects on the calendar as well.

Problem is, when i select a different week, all my data in the calendar is gone, and the week I click on is not updated in the calendar.

I tried changing the properties for the Calendar to postback/callback but it still doesn't work.

However, my Navigator is able to retain the data when I select a different week.

This is when

This is when i first debug the webform. enter image description here

And this is when i click on the Navigator (the calendar at the bottom). As shown, the data is gone.

How do i solve this problem?

-- You can see that the navigator retains the data shown by the date in bold.

These are the codes I've used.

protected void DayPilotCalendar1_Command (object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
{  
    switch (e.Command)
    {
        case "navigate":
        DateTime start = (DateTime)e.Data["EventStart"];
        DateTime end = (DateTime) e.Data["EventEnd"];
        DayPilotCalendar1.StartDate = start;
        DayPilotCalendar1.DataBind();
        DayPilotCalendar1.Update();
        break;
    }
}
Marco
  • 22,856
  • 9
  • 75
  • 124
user2037510
  • 27
  • 1
  • 1
  • 9

1 Answers1

1

You need to reload the event data as well:

protected void DayPilotCalendar1_Command (object sender, DayPilot.Web.Ui.Events.CommandEventArgs e)
{  
    switch (e.Command)
    {
        case "navigate":
        DateTime start = (DateTime)e.Data["EventStart"];
        DateTime end = (DateTime) e.Data["EventEnd"];
        DayPilotCalendar1.StartDate = start;
        DayPilotCalendar1.DataSource = LoadYourEventsHere(); // load data
        DayPilotCalendar1.DataBind();
        DayPilotCalendar1.Update();
        break;
    }
}

This is the missing part:

DayPilotCalendar1.DataSource = LoadYourEventsHere(); // load data
Dan
  • 2,157
  • 21
  • 15