Back to Devexpress

SchedulerDataStorage.FilterDependency Event

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-4a526155.md

latest3.9 KB
Original Source

SchedulerDataStorage.FilterDependency Event

Hides certain appointment dependencies in the Gantt view.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public event PersistentObjectCancelEventHandler FilterDependency
vb
Public Event FilterDependency As PersistentObjectCancelEventHandler

Event Data

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

PropertyDescription
CancelGets or sets whether to cancel the operation.
ObjectGets 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 AppointmentDependencyDataStorage. 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:

csharp
private void schedulerDataStorage1_FilterDependency(object sender, PersistentObjectCancelEventArgs e)
{
    e.Cancel = ((AppointmentDependency)e.Object).Type != AppointmentDependencyType.FinishToStart;
}
vb
Private Sub schedulerDataStorage1_FilterDependency(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs)
    e.Cancel = (CType(e.Object, AppointmentDependency)).Type <> AppointmentDependencyType.FinishToStart
End Sub

See Also

SchedulerDataStorage Class

SchedulerDataStorage Members

DevExpress.XtraScheduler Namespace