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 » How To » customize events (backcolour etc) using BeforeEventRender for Month view

customize events (backcolour etc) using BeforeEventRender for Month view

I have attempted to use BeforeEventRender for changing background colour in the month view however this event is not being triggered. My code is as follows:

Protected Sub DayPilotMonthX_BeforeEventRender(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.BeforeEventRenderEventArgs) 

Response.Write("red")
e.BackgroundColor = "red"

End Sub

It is also mentioned in the DayPilot:

<DayPilot:DayPilotMonth ID="DayPilotMonth" 
...
BeforeEventRender="DayPilotMonthX_BeforeEventRender"
EventClickHandling="PostBack" DataTagFields="Deleted"/>

However it is not responding. Any ideas?

Thanks

Joe

Joe - 7/2/2008 12:44:52 PM
1. Please try adding Handles .... section to the header:
Protected Sub DayPilotMonthX_BeforeEventRender(ByVal sender As Object, _
ByVal e As DayPilot.Web.Ui.Events.BeforeEventRenderEventArgs) _
Handles DayPilotMonthX.BeforeEventRender

2. Another option might be to change BeforeEventRender to OnBeforeEventRender in the .aspx source:

OnBeforeEventRender="DayPilotMonthX_BeforeEventRender" 
Let me know if it didn't help.
Dan Letecky - 7/3/2008 8:56:24 PM

Many thanks Dan - It was the 'On' that was missing

regards

Joe

Joe - 7/4/2008 10:15:23 AM
Post reply