Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Web Schedule Appointment formatting
posted

Hi,

I am trying to set the background colour of each appointment on a WebMonthView according to it's status in code-behind.  The relevant lines are being set, but not making any difference to what is displayed on the page. This is my code.


    Private Sub WebScheduleInfo1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebScheduleInfo1.DataBinding

        Dim appCol As AppointmentsSubsetCollection

        For Each app As Infragistics.WebUI.WebSchedule.Appointment In Me.WebMonthView1.WebScheduleInfo.Appointments

            appCol = WebScheduleInfo1.GetAppointmentsForDate(WebScheduleInfo1.ActiveResource, app.StartDateTimeUtc)

            For Each appt As Infragistics.WebUI.WebSchedule.Appointment In appCol

                If (appt.Status = 0) Then
                    appt.Style.CustomRules = "background-color:orange !important;"
                    appt.Style.BackColor = Drawing.Color.Orange
                ElseIf (appt.Status = 1) Then
                    appt.Style.CustomRules = "background-color:cyan !important;"
                    appt.Style.BackColor = Drawing.Color.Cyan
                ElseIf (appt.Status = 2) Then
                    appt.Style.CustomRules = "background-color:lightgreen !important;"
                    appt.Style.BackColor = Drawing.Color.LightGreen
                ElseIf (app.Status = 3) Then
                    appt.Style.CustomRules = "background-color:red !important;"
                    appt.Style.BackColor = Drawing.Color.Red
                End If

            Next

        Next

    End Sub

Is there a setting on the WebMonthView, WebSchedule or WebScheduleGenericDataProvider that would be overriding what I'm doing?