Creating and adding resources to the RadScheduler is quite simple. In fact, assigning resources to appointments is by no means a new feature of the RadScheduler. The following code creates and adds a resource to the RadScheduler:
If you've used resources in the past, you will notice that there is a new property, Color. The color property is used to set the color of the grouping section in the RadScheduler. If you refer to the image of the RadScheduler above, you will notice that each section is a unique color based on its respective resource.
If you prefer to bind data to the RadScheduler rather than creating it by hand, you are in luck. The SchedulerBindingDataSource object included with the RadControls for WinForms handles this for you. I will spare you the details of using the SchedulerBindingDataSource, as you can read about it here.
Enabling the RadScheduler to use resource grouping is quite simple. Setting the GroupType property of the RadScheduler to GroupType.Resource will do the trick. You can also set the visible resources per view using the ResourcesPerView property.
If the end user has the ability to change the active view, you will need to make sure to subscribe to the ActiveViewChanged event so you can set the ResourcesPerView property on the new view when it is generated.
Scrolling through the grouped resources is as easy as using the horizontal scroll bar available at the bottom of the scheduler control. When creating a new appointment, you can specify what resource that appointment belongs to and the appointment will show up under the respective resource grouping. You can also drag appointments between resource groupings. Upon doing so, the dragged appointment's resource will automatically be updated.
Subscribe to be the first to get our expert-written articles and tutorials for developers!