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

DayPilotMonth not Updating (build 1385, trial version)

Asked by D. Ball
14 years ago.

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
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 
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.


Comment posted by Dan Letecky
14 years ago.
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).
Comment posted by D. Ball
14 years ago.

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.

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