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
130
How to have multi colors in the appointments?
posted

Hi,

I wanted appointments on the calendar to have multiple colors but I'm not able to create the resource to change the color of the color scheme.

Can someone help me?

Thank you,

Diogo Queirós

Parents
  • 1530
    Verified Answer
    posted

    Hi Diogo ,

    You can easily create ScheduleResources like this:


    // Create some resources
    ObservableCollection<ScheduleResource> resources = new ObservableCollection<ScheduleResource>();
    resources.Add(new ScheduleResource("ID1", "Bob Smith") { ColorScheme = ScheduleResourceColorScheme.Chocolate });
    resources.Add(new ScheduleResource("ID2", "Joe Davis") { ColorScheme = ScheduleResourceColorScheme.Fuchsia });
    resources.Add(new ScheduleResource("ID3", "Tim Jones") { ColorScheme = ScheduleResourceColorScheme.Grape });

    and then just assign the resource id to the appointments:

      // Appointments contained in a single day.
                appts.Add(new Appointment
                {
                    Start = MakeDateTime(date, 12, 0, 0),
                    End = MakeDateTime(date, 12, 15, 0),
                    Subject = "Daily Meeting 1",
                    Location = "Conference Room 1",
                    ResourceId = resources[0].Id,
                });

                appts.Add(new Appointment
                {

                    Start = MakeDateTime(date, 13, 0, 0),
                    End = MakeDateTime(date, 13, 15, 0),
                    Subject = "Daily Meeting 2",
                    Location = "Conference Room 2",
                    ResourceId = resources[1].Id,
                });

    I have attached a sample which demonstrates how to do this.

    If you require any further assistance on the matter, please let me know.

    Sincerely,
    Teodor Tenev
    Software Developer

    Scheduler_App.zip
Reply Children