Skip to main content
A newer version of this page is available. .

How to: Filter Resources

The following example demonstrates how to filter the resources shown within a Scheduler Control according to some condition. For this the SchedulerDataStorage.FilterResource event is used. The code below demonstrates how to show only the first three resources.

using DevExpress.XtraScheduler;
// ...

private void schedulerDataStorage1_FilterResource(object sender, PersistentObjectCancelEventArgs e) {

    SchedulerDataStorage storage = (SchedulerDataStorage) sender;
    Resource res = (Resource) e.Object;
    // Filter the first three resources in a collection.
    e.Cancel = storage.Resources.Items.IndexOf(res) > 2 ;

}