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.
Xaml |
<dxsch:SchedulerControl.Storage>
<dxsch:SchedulerStorage FilterResource="SchedulerStorage_FilterResource"/>
</dxsch:SchedulerControl.Storage>
|
C# |
using DevExpress.XtraScheduler;
private void SchedulerStorage_FilterResource(object sender, PersistentObjectCancelEventArgs e) {
Resource res = (Resource)e.Object;
e.Cancel = schedulerControl1.Storage.ResourceStorage.Items.IndexOf(res) > 2;
}
|
VB |
Imports Microsoft.VisualBasic
Imports DevExpress.XtraScheduler
Private Sub SchedulerStorage_FilterResource(sender As System.Object, _
e As PersistentObjectCancelEventArgs)
Dim res As Resource = CType(e.Object, Resource)
e.Cancel = schedulerControl1.Storage.ResourceStorage.Items.IndexOf(res) > 2
End Sub
|