Skip to main content

How to: Filter Resources (legacy)

Note

You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.

This example demonstrates how to use the SchedulerStorage.FilterResource event to filter resources shown within a Scheduler Control according to some conditions. Specifically, the code below shows only the first three resources.

using DevExpress.XtraScheduler;
// ...

private void SchedulerStorage_FilterResource(object sender, PersistentObjectCancelEventArgs e) {
    Resource res = (Resource)e.Object;
    // Filter the first three resources in a collection.
    e.Cancel = schedulerControl1.Storage.ResourceStorage.Items.IndexOf(res) > 2;
}