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

special dates

Asked by Sjef ten Koppel
12 years ago.

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

Comment posted by Dan Letecky
12 years ago.

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 Sjef ten Koppel
12 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 Dan Letecky
12 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 Sjef ten Koppel
12 years ago.

thank you very much that was the answer I needed!

Comment posted by Darren Roberts
11 years ago.

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

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