- 2 minutes to read
Resources are entities associated with appointments. Resources ResourceItem class instances and they allow end-users to group and sort appointments. A scheduler resources' collection is available using the SchedulerControl.ResourceItems property.
Resources can be stored in the data source. To use them in a scheduler, bind a data source to the DataSource.ResourcesSource property and specify the DataSource.ResourceMappings. The DataSource.ResourceMappings property can be set to either a collection of resource IDs or a string in the XML format.
Resource sharing means that an appointment is associated with several resources. To enable resource sharing, set the DataSource.ResourceSharing property to true. Resources can be:
To assign an appointment to a particular resource, set the appointment's AppointmentItem.ResourceId property to the appropriate resource's SourceObjectContainer.Id value. A resource can be linked with several appointments, as illustrated in the image below.
The image below demonstrates shared resources.
If an appointment doesn't belong to any particular resource (the AppointmentItem.ResourceId property is set to the EmptyResourceId), it is considered assigned to all resources. Hence, this appointment is shown for all resources.
Grouping by Resources
A resource becomes visible in the scheduler grouped by either resources (the SchedulerControl.GroupType is set to the SchedulerGroupType.Resource value ) or dates (the SchedulerControl.GroupType is set to the SchedulerGroupType.Date value).
If the ResourceItem.Visible property of any resource is set to false, and the scheduler is grouped by resources or dates, all appointments that belong to this resource are hidden.
The following images demonstrate the Day View when appointments are grouped by a resource...
... and a date:
In the grouped Timeline View, resources are shown vertically on the left.
The Resource Navigator control is automatically displayed in the scheduler's bottom right corner when grouping is enabled. The control allows end-users to scroll through resources and change the number of resources shown on the screen at once.
|SchedulerControl.ResourceItems||Provides access to the collection of resources for appointments.|
|SchedulerControl.VisibleResources||Provides access to the collection of currently visible resources.|
|SchedulerControl.SelectedResource||Gets or sets the resource currently selected in the scheduler.|
|SchedulerControl.SelectedResourceSource||Gets or sets the source object for the selected resource.|
|SchedulerControl.GetResourceItemBySourceObject||Returns a resource associated with the specified source object.|