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

How to set DayPilot calendar DayBeginsHour and DayBeginsHour dynamically

Asked by Wilna
6 years ago.

Hi, how do you set the value of the DayBeginsHour and/or DayBeginsHour dynamically? cuz when I give DayBeginsHour a value that depends on the earliest event of the week, the calendar goes blank after navigating using the navigator.

I have the following code and it is not working:

DayPilotCalendar1.DayBeginsHour = earliestEventHour;
DayPilotCalendar1.DayEndsHour = 20;

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

Not all properties are synchronized during the CallBack update - forcing the full update using DayPilotCalendar1.Update(CallBackUpdateType.Full) doesn't help.

1. You can place the Calendar control inside an UpdatePanel and refresh it traditionally (it will be created from scratch).

2. You can change the dayBeginsHour and dayEndsHour properties on the client-side using JavaScript and call .update():

dp.dayBeginsHour = 6;
dp.dayEndsHour = 20;

"dp" is the value of ClientObjectName property.

You can call this code in AfterRender handler (which is fired after CallBack updates):

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