Skip to main content

SchedulerStorage.FilterResource Event

Enables specific resources to be hidden in the Scheduler Control.

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v14.2.dll

#Declaration

public event PersistentObjectCancelEventHandler FilterResource

#Event Data

The FilterResource event's handler receives an argument of the PersistentObjectCancelEventArgs type. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the operation performed on the processed event should be canceled.
Object Gets the persistent object for which the event was raised. Inherited from PersistentObjectEventArgs.

#Remarks

Handle the FilterResource event to hide specific resources in the SchedulerControl. This event fires each time the layout of the scheduler control is modified (when new appointments are added, or existing ones are modified, etc). You can also force the layout to be updated by calling the SchedulerViewBase.LayoutChanged method.

The FilterResource event is raised in turn for each resource in the ResourceStorage. If the PersistentObjectCancelEventArgs.Cancel parameter is set to true for the currently processed resource, this resource will be hidden in the scheduler control. Specifically, the resource will not be displayed when appointments are grouped by resources (see the SchedulerControl.GroupType topic).

#Examples

This example demonstrates how to use the SchedulerStorage.FilterResource event to filter resources shown within a Scheduler Control based on specified 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;
}
See Also