DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » General » DayPilotMonth not Updating (build 1385, trial version)

DayPilotMonth not Updating (build 1385, trial version)

I am having trouble with the Update method of the the DayPilotMonth control. I am calling the javascript refreshCallBack and the timeRangeSelectedCallBack functions and these call the following code behind functions:

Protected Sub DayPilotMonth1_Refresh(ByVal sender As Object, ByVal e AsDayPilot.Web.Ui.Events.RefreshEventArgs) Handles DayPilotMonth1.Refresh 
DayPilotMonth1.StartDate = Me.CurrentDate
DayPilotMonth1.Update()
End Sub


Protected Sub DayPilotMonth1_TimeRangeSelected(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.TimeRangeSelectedEventArgs) Handles DayPilotMonth1.TimeRangeSelected
    Me.CurrentDate = e.Start 
DayPilotMonth1.Update()
End Sub

The control does not refresh in either case. I have event handlers on the BeforeCellRender and BeforeHeaderRender events, and these are not being called. I have also tried doing a direct callback rather than the javascript call, and the update does not work in this case either. The page also has a Calendar and a Scheduler on it and both of these controls update properly. Have I run into a bug or do I need to set a property to make the update work.

Thanks

D. Ball - 4/22/2008 10:31:23 PM
1. Refresh
The Me.CurrentDate value is not persisted between two CallBack calls (unless it's you store the value in a Session or a similar place in the setter). In Refresh event handler you should rather operate with the date coming in the EventArgs (e.StartDate). You can send this value in the first .refreshCallBack() parameter. .refreshCallBack accepts two different:
  • .refreshCallBack(integer) sets e.StartDate to x months forwards (e.g. .refreshCallBack(1)) or backwards (e.g. refreshCallBack(1)).
  • .refreshCallBack(Date) sets e.StartDate to the specified Date.
So if you want to change the month from within TimeRangeSelected event, you need to handle it by JavaScript and call .refreshCallBack(start) from that JavaScript.

2. BeforeCellRender
There is a bug in build 1385 that prevents BeforeCellRender from being fired during CallBack. It has been fixed in build 1394 (DayPilot Pro 4.7 beta).

3. BeforeHeaderRender
Another bug. I've fixed it right now - thanks for reporting it! The fix will appear in the next release (4.7 final).
Dan Letecky - 4/22/2008 11:00:09 PM

Many thanks. Those two bugs were causing my problem because the update I was looking for required the cellrender event. I will get the latest version and try again.

D. Ball - 4/23/2008 2:43:46 PM
Post reply