Have got it working :-)
Used the follwing and this works fine:
[code]
Protected Sub DayPilotScheduler1_BeforeTimeHeaderRender(sender As Object, e As DayPilot.Web.Ui.Events.BeforeTimeHeaderRenderEventArgs)
Dim objConnection As SqlConnection
Dim objCommand As SqlCommand
objConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("OPSDConnectionString").ConnectionString)
objCommand = New SqlCommand("SELECT name, time_start, time_end FROM tblrb_periods WHERE bookable = 1 ORDER BY time_start asc", objConnection)
Try
objConnection.Open()
Dim objPeriodDataReader As SqlDataReader
Dim startHour As Integer = 0
objPeriodDataReader = objCommand.ExecuteReader()
While objPeriodDataReader.Read()
Dim strStart As String = objPeriodDataReader("time_start").ToString()
Dim strEnd As String = objPeriodDataReader("time_end").ToString()
'Remove trailing :00 from time
strStart = strStart.Substring(0, strStart.Length - 3)
strEnd = strEnd.Substring(0, strEnd.Length - 3)
If startHour = e.Start.Hour Then
e.InnerHTML = "<div style='position:relative'><span style='position:relative; left: -10px;'>" & objPeriodDataReader("name") & "</div>"
e.ToolTip = objPeriodDataReader("name") & " - " & strStart & " - " & strEnd
If Not e.IsColGroup Then
e.InnerHTML = "<div style='color:gray; font-size:8pt; position:relative'><span style='position:relative; left: -10px;'>" & strStart & " - " & strEnd & "</span></div>"
End If
End If
startHour = startHour + 1
End While
Catch ex As Exception
'Inform of the error
Finally
objCommand.Dispose()
objConnection.Close()
objConnection.Dispose()
End Try
End Sub
[/code]
The only other that needs doing is you have to set the BusinessEndsHour equal to the number of leesons/periods you have have. (remember this is a zero based count i.e. 0 1 2 3 4 would be BusinessEndsHour=5)
Now to populate with bookings :-)