This is a migrated thread and some comments may be shown as answers.

Q3 2009 Appointment Backcolor

2 Answers 87 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 02 Dec 2009, 09:53 AM
Hi,
I have just upgraded my code to Q3 2009 from Q2 2008.
Within my scheduler i hade made appointments different colours depending on the resource.
Here is my code...
Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated  
        If Not e.Appointment.Attributes("ResourceBackColor") = Nothing Then 
            Dim rsWrap As WebControl = e.Container.Parent.Parent.Parent.Parent.Parent  
            Dim rsApt As WebControl = e.Container.Parent.Parent.Parent.Parent  
            Dim rsAptWrap As WebControl = e.Container.Parent.Parent.Parent  
            Dim rsAptInner As WebControl = e.Container.Parent.Parent  
            rsAptInner.Style("background-color") = e.Appointment.Attributes("ResourceBackColor")  
        Else 
            Dim rsWrap As WebControl = e.Container.Parent.Parent.Parent.Parent.Parent  
            Dim rsApt As WebControl = e.Container.Parent.Parent.Parent.Parent  
            Dim rsAptWrap As WebControl = e.Container.Parent.Parent.Parent  
            Dim rsAptInner As WebControl = e.Container.Parent.Parent  
            rsAptInner.Style("background-color") = "Khaki" 'STD COLOUR  
        End If 
End Sub 
This does not seem to change the backcolor anymore.
Any ideas please ?

Many Thanks
Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 02 Dec 2009, 11:40 AM
Hello,

Have you tried the following approach in order to set the back-color for appointment?

VB:
 
Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) 
    If condition Then ' Check for the condition 
        e.Appointment.BackColor = System.Drawing.Color.Red 
    End If 
End Sub 

Also checkout the documentation to know more about this: Setting styles for appointments

-Shinu.
0
Mark
Top achievements
Rank 1
answered on 02 Dec 2009, 12:13 PM
Hi,
thanks that worked.
Sometimes the answer is soooo obvious you cant see it !!!

Mark
Tags
Scheduler
Asked by
Mark
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Share this question
or