Hi,
I get this exception if the calendar has the BeforeEventRender event. Why this happen?
This happen because the Source is null, how I can set this property?
Answer:-
Add PreRender Event of Daypilot and Bind DayPilotCalander ,
like
protected void DayPilotCalendar1_PreRender(object sender, EventArgs e)
{
BindDayPilotBookings();
}
protected void BindDayPilotBookings()
{
DayPilotCalendar1.StartDate = Convert.ToDateTime(DateTime.Today);
DayPilotCalendar1.BusinessBeginsHour = 9;
DayPilotCalendar1.BusinessEndsHour = 20;
DataTable dt = BAL_Class.GetAllBookingsByAdmin();
DayPilotCalendar1.DataSource = dt;
DayPilotCalendar1.DataStartField = "Start_Time";
DayPilotCalendar1.DataEndField = "End_Time";
DayPilotCalendar1.DataTextField = "Agenda";
DayPilotCalendar1.DataIdField = "Booking_Id";
DayPilotCalendar1.ItemType = "Status";
DayPilotCalendar1.DataBind();
}