This example shows how you can sort scheduler resources. Actual sorting is performed via the SchedulerStorage.Resources.Items.Sort() method call. Note that custom comparers (see Comparers.cs file) are used to compare resource items by desired criteria (in this example, this is a Resource.Caption Property and a number of appointments, which each resource has). Also, we demonstrated how to prevent sorting (in "ResourceNOfAppointments" sorting mode) for a special "Unassigned" resource. This resource is always displayed first.
The original arrangement order could be easily restored via the SchedulerControl.RefreshData Method. As for the automatic re-sorting when the underlying collection (which is bound to resources) is changed, handle the SchedulerStorageBase.ResourceCollectionLoaded Event. Both approaches are illustrated in this example.
Question Comments
Added By: Gerard D'Rozario at: 2/9/2015 6:34:23 PM
If the resources that appear can be selected via checkboxes, how do we display the resources in the order they get selected by the end user? For example there are 3 resources, Room A, Room B, Room C. At startup none are selected. The user clicks the Room B checkbox and appointments for Room B appear. The user checks the Room A checkbox. Appointments for Room A now appear, but to the LEFT of the Room B appointments. I would like it to appear to the right because that is the order the user selected it. - Thanks.
Added By: George (DevExpress Support) at: 2/10/2015 6:30:38 AMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T207245: SchedulerControl - How to sort resources in the order they were selected. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.