Skip to main content

SchedulerStorageBase.FilterDependency Event

Hides certain appointment dependencies in the Gantt view.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.1.Core.Desktop.dll

NuGet Package: DevExpress.Scheduler.CoreDesktop

Declaration

public event PersistentObjectCancelEventHandler FilterDependency

Event Data

The FilterDependency event's data class is PersistentObjectCancelEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether to cancel the operation.
Object Gets the persistent object (appointment, resource or appointment dependency) for which the event occurs. Inherited from PersistentObjectEventArgs.

Remarks

You can handle the FilterDependency event to hide specific appointment dependencies in the Gantt View. This event fires each time the layout of the Scheduler control is modified (when the control is resized, when new appointments or dependencies are added, or existing ones are modified, etc.) You can also force the layout to be updated by calling the SchedulerViewBase.LayoutChanged method.

The FilterDependency event is raised for each dependency in the AppointmentDependencyStorage. If the PersistentObjectCancelEventArgs.Cancel parameter is set to true for the currently processed dependency, then this dependency will be hidden in the Scheduler control.

Important

Subscribe to the FilterDependency event before storage initialization (before the PersistentObjectStorage<T>.DataSource is assigned), otherwise the filter is not applied.

This event enables you to specify dependencies for visualization. Do not modify their properties, and do not add or remove dependencies within this event handler. An attempt to do so may result in an unhandled exception.

The following code snippet hides all dependencies other than those of the AppointmentDependencyType.FinishToStart type:

private void schedulerStorage1_FilterDependency(object sender, PersistentObjectCancelEventArgs e)
{
    e.Cancel = ((AppointmentDependency)e.Object).Type != AppointmentDependencyType.FinishToStart;
}

Implements

See Also