New to Telerik UI for WinFormsStart a free 30-day trial

Customize Appointment Backgrounds and Statuses in RadScheduler

Updated over 6 months ago

Environment

Product VersionProductAuthor
2019.1.219RadScheduler for WinFormsDesislava Yordanova

Description

RadScheduler offers a predefined list of available statuses and backgrounds for its appointments. They are stored in the Statuses and Backgrounds collections respectively:

customize-appointment-backgrounds-and-statuses001

However, if none of the available options is suitable for your specific scenario, you can add your custom status or background.

Solution

Adding a custom status

It is necessary to define a new AppointmentStatusInfo instance and specify the status' ID, display name and colors.

customize-appointment-backgrounds-and-statuses002

Define a custom AppointmentStatusInfo

C#

AppointmentStatusInfo myStatus = new AppointmentStatusInfo(100, "InProduction", Color.Red, Color.White, AppointmentStatusFillType.Hatch);
this.radScheduler1.Statuses.Add(myStatus);
Appointment myEvent = new Appointment(DateTime.Now, TimeSpan.FromHours(3), "Business Lunch");
myEvent.StatusId = 100;  
this.radScheduler1.Appointments.Add(myEvent);      
       

Adding a custom background

It is necessary to define a new AppointmentBackgroundInfo instance and specify the background's ID, display name and colors.

customize-appointment-backgrounds-and-statuses003

Define a custom AppointmentBackgroundInfo

C#

AppointmentBackgroundInfo myBackground = new AppointmentBackgroundInfo(12, "My background", Color.Cyan, Color.Fuchsia);
this.radScheduler1.Backgrounds.Add(myBackground);
Appointment myEvent = new Appointment(DateTime.Now, TimeSpan.FromHours(3), "Business Lunch");
myEvent.BackgroundId = 12;
this.radScheduler1.Appointments.Add(myEvent);