Welcome Guest Search | Active Topics | Sign In | Register

calendar control: e.Day.IsSelectable = False Options
turpya
Posted: Friday, July 18, 2008 5:44:34 PM
Rank: Member
Groups: Member

Joined: 6/8/2007
Posts: 19
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
eo_support
Posted: Friday, July 18, 2008 8:43:19 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Hi,

Our control does not recongizes IsSelectable. You will need to use MaxValidDate and MinValidDate and DisabledDates to control which day is selectable.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.