DayPilot Pro 5.7 SP2 (showbusinesshours on Saturday)
Asked by Anonymous 17 years ago.
Got a scheduler showing 1 day, when I navigate to Sat it falls over when showbusinesshours = false.
Although Saturday has business set, looking at the screen in dp 5.6 seams to suggest that it contains no business hours.
So the issues are
.BusinessBeginsHour & .BusinessEndsHour are set but it appears to show Saturday as having no business hours
If there are genuinely no businesshours it should revert to showing all hours (or least give a error that states the reason)
Tried the following which makes the cal show as working hours in 5.6 but wont stop the error in 5.7
Protected Sub DayPilotScheduler1_BeforeCellRender(ByVal sender As Object, ByVal e As DayPilot.Web.Ui.Events.BeforeCellRenderEventArgs) Handles DayPilotScheduler1.BeforeCellRender
Dim DOW As DayOfWeek = e.Start.DayOfWeek
If DOW = DayOfWeek.Saturday Or DOW = DayOfWeek.Sunday Then
Dim Hr As Int32 = e.Start.Hour
If Hr >= BusinessBeginsHour And Hr <= BusinessEndsHour Then
e.IsBusiness = True
End If
End If
End Sub
Comment posted by Dan Letecky 17 years ago.
Good approach, but a wrong place.
Since BeforeCellRender is called for cells in all rows it wouldn't be possible to hide/show a column there. Marking a cell with IsBusiness = False only changes the cell color.
The right event is BeforeTimeHeaderRender:
Check if it's the regular column and not a column group (Not e.IsColGroup).
Set e.Visible = True for columns you want to make visible (for Saturday)
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.