aspnetbootstrap-120305-scheduler-resources.md
Jun 19, 2020
4 minutes to read
In real-life scheduling applications, appointments are seldom processed simply “as is”, but usually are assigned to different resources. There are different kinds of resources, and the decision as to what should be a resource in a particular scheduling application depends upon the specifics of the task solved by the application. Here are some examples of scheduling tasks, illustrating what can be an appointment and a resource in these examples.
A Business.
A Car Rental Agency.
An Educational Center.
An appointment can have one or several resources assigned to it. If it has no resources assigned, then it is assumed that any resource can be associated with that appointment.
A single resource is an object that exposes the Resource interface. All of scheduler’s resources are stored in the ASPxResourceStorage (which is a part of the Scheduler Storage and is accessed via its ASPxSchedulerStorage.Resources property).
If a Resource Storage contains at least one resource, then it is possible to assign appointments to resources. This may be done in different ways, depending on whether resource sharing is enabled or not.
Resources are not shared , i.e. the AppointmentStorageBase.ResourceSharing property is set to false.
Resources are shared , i.e. the AppointmentStorageBase.ResourceSharing property is set to true.
A resource becomes enabled in the Scheduler only when its data is shown grouped by either dates (SchedulerControl.GroupType is set to SchedulerGroupType.Date) or by resources (SchedulerControl.GroupType is set to SchedulerGroupType.Resource).
Note
If the Resource.Visible property of any resource is set to false , and appointments grouping is enabled, then all the appointments that belong to this resource will be hidden.
The following image demonstrates the common look of the Scheduler Control grouped by resources in the Day View.
The Resource Navigator element is shown when the scheduler enters the group mode. It can be used by end-users to scroll through resources, and to change the number of resources displayed at one time on screen. To hide the Resource Navigator , set its ResourceNavigator.Visibility property to ResourceNavigatorVisibility.Never.
Note
You can manually set the number of resources visible at once on a screen for every view via the SchedulerViewBase.ResourcesPerPage property of the appropriate view.
The Scheduler control uses the mappings mechanism to bind scheduler objects to the data fields. See the ASPxResourceMappingInfo class description for the mappings overview.
Specify the following data field mapping properties (available through ASPxResourceStorage.Mappings) to allow the Scheduler control to save and retrieve resource data to/from the data source.
Additionally, specify the ASPxAppointmentMappingInfo.ResourceId property to store appointments’ associated resource.
To learn more, see the Resource Data Binding demo online.