# Working with Resources

When **RadScheduler** is [grouped by resources](https://www.telerik.com/products/winforms/documentation/controls/scheduler/views/grouping-by-resources), it stores them in the **Resources** collection. Each **Resource** offers the following properties:

| Resource's properties | Description                                                       | Type      |
| --------------------- | ----------------------------------------------------------------- | --------- |
| **Name**              | Gets or sets the name of the resource.                            | *string*  |
| **Id**                | Gets or sets the id of the resource.                              | *EventId* |
| **Image**             | Gets or sets the image of the resource.                           | *Image*   |
| **Visible**           | Gets or sets a value indicating whether this resource is visible. | *bool*    |
| **Color**             | Gets 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 **EventId**s to which this appointment is associated.

> note 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);
```

```VB.NET
Dim appointment As Appointment = New Appointment(DateTime.Today.AddDays(1).AddHours(12).AddMinutes(30), TimeSpan.FromHours(2), "Business Lunch")
appointment.ResourceId = Me.radScheduler1.Resources(2).Id
Me.radScheduler1.Appointments.Add(appointment)
```

![WinForms RadScheduler Appointment Resource](https://www.telerik.com/products/winforms/documentation/assets/be732060add87c2d2df017406ca93649/winforms-scheduler-working-with-resources001.png)

#### 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);
```

```VB.NET
Dim appointmentWithMultipleResources As Appointment = New Appointment(DateTime.Today.AddDays(1).AddHours(12).AddMinutes(30), TimeSpan.FromHours(2), "Business Lunch")
appointmentWithMultipleResources.ResourceIds.Add(Me.radScheduler1.Resources(2).Id)
appointmentWithMultipleResources.ResourceIds.Add(Me.radScheduler1.Resources(1).Id)
Me.RadScheduler1.Appointments.Add(appointmentWithMultipleResources)
```

![WinForms RadScheduler Multiple Resources](https://www.telerik.com/products/winforms/documentation/assets/936e2eef4df73f65793370559d9c10ca/winforms-scheduler-working-with-resources002.png)

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

![WinForms RadScheduler EditAppointmentDialog Resource](https://www.telerik.com/products/winforms/documentation/assets/5e69a1515fd5d6bb41cd4df7530d7ca8/winforms-scheduler-working-with-resources003.png)

> important 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](https://www.telerik.com/products/winforms/documentation/assets/3499872d18522eb49ce46b4177c06e02/scheduler-winforms-scheduler-dialogs-editappointmentdialog003.png)

## See Also

* [Working with Appointments](https://www.telerik.com/products/winforms/documentation/controls/scheduler/appointments-and-dialogs/working-with-appointments)
* [Grouping by Resources](https://www.telerik.com/products/winforms/documentation/controls/scheduler/views/grouping-by-resources)
* [How to Display Multiple Resources in EditAppointmentDialog](https://www.telerik.com/products/winforms/documentation/knowledge-base/scheduler-multiple-resource-in-edit-dialog)
* [How to Show Columns in Resource Headers](https://www.telerik.com/products/winforms/documentation/knowledge-base/resource-columns-in-radscheduler)
