Home Unanswered Active Tags New Question

special dates

Hello, I like your tool very much. I'v a small issue however. How do I give cells in the scheduler a diff. color e.g 25th december should be red. I tried with before cell render but it's not working

something like this:

Protected Sub DayPilotScheduler1_BeforeCellRender(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.BeforeCellRenderEventArgs) Handles DayPilotScheduler1.BeforeCellRender

If e.Start.Date = CDate("01.06.2009") Then 'just try

e.BackgroundColor = "red"

End If
end sub

Asked by Sjef ten Koppel 2 years ago.
Replies

It should work exactly like this. I would only make sure that the date in is converted properly in CDate call. I've used the following code at it works fine:

Protected Sub DayPilotScheduler1_BeforeCellRender(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.BeforeCellRenderEventArgs) Handles DayPilotScheduler1.BeforeCellRender
  If e.Start = New DateTime(2009, 6, 1) Then
    e.BackgroundColor = "red"
  End If
End Sub
Comment posted by Dan Letecky 2 years ago.

thanks for your reply I've got this working it was the cdate how could I overlook that. Do you know how to get a tooltip on thes "special" dates e.g

If e.Start = New DateTime(2009, 12, 25) Then
e.BackgroundColor = "red"
should generate a tooltip like "Christmas" or (xxxx, 1, 1) "New Year"

Comment posted by Sjef ten Koppel 2 years ago.

The tooltip can be added to the header using BeforeTimeHeaderRender:

  1. Detect the second header row using e.IsGroup.
  2. Set e.ToolTip.

You would have to modify the source code in order to show tooltips for the actual time cells.

Comment posted by Dan Letecky 2 years ago.

thank you very much that was the answer I needed!

Comment posted by Sjef ten Koppel 2 years ago.

Where would you modify the source code in order to have a tooltip on any cell?

Comment posted by Darren Roberts 1 year ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java