Hi,
I'd like to make only dates that are present in a datatable, selectable. I'm trying to use e.Day.IsSelectable = False within the OnDayRender Sub, when a date is not found in the datatable. Please see sample code below. When I execute the page, all days within the month are selectable. Am I doing something wrong?
Code: Visual Basic.NET
Sub calDRender(ByVal sender As Object, ByVal e As EO.Web.DayRenderEventArgs)
Dim lbl As New Label
Dim dayDate As DateTime
'If the month is CurrentMonth
If Not e.Day.IsOtherMonth Then
For Each dtRow In dtDates.Rows
If IsDate(dtRow.Item(0)) Then
dayDate = dtRow.Item(0)
If dayDate = e.Day.Date Then
lbl.Height = "60"
lbl.Width = "80"
'lbl.BackColor = Color.Orange
lbl.ForeColor = Color.Black
lbl.Text = e.Day.DayNumberText & "<BR/>Available: " & dtRow.Item(1)
lbl.RenderControl(e.Writer)
Exit Sub
End If
End If
Next
e.Day.IsSelectable = False
lbl.ForeColor = Color.Black
lbl.Text = e.Day.DayNumberText
lbl.RenderControl(e.Writer)
End If
End Sub