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
40
Set the background color of appointment added in code
posted

I am having a problem setting the background color of an appointment when adding it on the server.  I found a couple of entries in the forum about changing background color but it is not working for me.  I am adding some appointments server side and based on a flag in the class I am pulling data from, I wanted to effectively color code the appointment.  Here is my code (item is a custom class containing the data to be used to populate the appointment):

    Appointment appt = new Appointment(ucScheduleInfo);
    appt.StartDateTime = new SmartDate(item.Detail.StartDate);
    appt.Duration = new TimeSpan(0, 0, item.Detail.Duration);
    appt.Subject = "Leave Type" + item.Detail.LeaveID.ToString();
    appt.EnableReminder = false;
    appt.Key = String.Format("0,{0}", item.Detail.LeaveID);
....
    if(item.someflag)
    {
         appt.Style.BackColor = System.Drawing.Color.Red;
    }

The appointment still renders as the default white.  What am I missing?  Thanks in advance for the help!

Todd