RadScheduleView set colors for every appointment/item

1 Answer 17 Views
ScheduleView
Egbert
Top achievements
Rank 1
Egbert asked on 27 Feb 2024, 02:22 PM

Hi,

We are using the scheduler in an old asp.net app (see attachment).

How do we set the background, foreground and border color for every single appointment/item.

For example: An Appointment/item now has the following properties:

            var app1 = new Appointment()
            {
                Subject = "Front-End Meeting",
                Start = DateTime.Today.AddHours(9),
                End = DateTime.Today.AddHours(10)
                ForeColor = "Red",
                BackColor = "Blue",
                BorderColor = "Black"
            };

Thanks and best regards,
Egbert

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 28 Feb 2024, 09:53 AM

Hello Egbert,

To achieve your requirement, you can create a custom class that derives from Appointment and define a new Brush property. Then, you can use the AppointmentStyleSelector of RadScheduleView to data bind the Background of the AppointmentItem visuals to the new Brush property in the custom appointment. You can see this approach shown in the attached project. I hope this helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Egbert
Top achievements
Rank 1
commented on 29 Feb 2024, 10:45 AM

This works great.

Thanks.....

Tags
ScheduleView
Asked by
Egbert
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or