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

Working with Resources

Updated over 6 months ago

When RadScheduler is grouped by resources, it stores them in the Resources collection. Each Resource offers the following properties:

Resource's propertiesDescriptionType
NameGets or sets the name of the resource.string
IdGets or sets the id of the resource.EventId
ImageGets or sets the image of the resource.Image
VisibleGets or sets a value indicating whether this resource is visible.bool
ColorGets or sets the color that is associated with the resource.Color

One Appointment may refer to one or many resources. Each Appoinment offers two properties that allow managing its resource/resources:

  • ResourceId - represents the EventId of the resource to which this appointment is associated.
  • ResourceIds - represents an ObservableCollection of EventIds to which this appointment is associated.

Using the EditAppointmentDialog allows you to assign only a single resource for the appointment. If you want to specify which multiple resources exactly are applied, it can be set programmically to the Appointment via the ResourcesIds property. However, selecting Any from the dialog, will generate an event for all existing resources in RadScheduler.

Apply a single resource to an appointment

C#
            Appointment appointment = new Appointment(DateTime.Today.AddDays(1).AddHours(12).AddMinutes(30), TimeSpan.FromHours(2), "Business Lunch");
            appointment.ResourceId = this.radScheduler1.Resources[2].Id;
            this.radScheduler1.Appointments.Add(appointment);

WinForms RadScheduler Appointment Resource

Apply multiple resources to an appointment

C#
            Appointment appointmentWithMultipleResources = new Appointment(DateTime.Today.AddDays(1).AddHours(12).AddMinutes(30), TimeSpan.FromHours(2), "Business Lunch");
            appointmentWithMultipleResources.ResourceIds.Add(this.radScheduler1.Resources[2].Id);
            appointmentWithMultipleResources.ResourceIds.Add(this.radScheduler1.Resources[1].Id);
            this.radScheduler1.Appointments.Add(appointmentWithMultipleResources);

WinForms RadScheduler Multiple Resources

When multiple resources are associated with an appointment, the Resource field in the EditAppointmentDialog shows Any:

WinForms RadScheduler EditAppointmentDialog Resource

As of R1 2021 the EditAppointmentDialog provides UI for selecting multiple resources per appointment. In certain cases (e.g. unbound mode), the Resource RadDropDownList is replaced with a RadCheckedDropDownList. Otherwise, the default drop down with single selection for resources is shown. To enable the multiple resources selection in bound mode, it is necessary to specify the AppointmentMappingInfo. Resources property. The Resources property should be set to the name of the relation that connects the Appointments and the AppointmentsResources tables.

EditAppointmentDialog with multiple Resources

WinForms RadScheduler EditAppointmentDialog Multiple Resources

See Also

In this article
See Also
Not finding the help you need?
Contact Support