SchedulerStorage.FilterAppointment Event
Enables specific appointments to be hidden in the Scheduler Control.
Namespace: DevExpress.Xpf.Scheduler
Assembly: DevExpress.Xpf.Scheduler.v14.2.dll
#Declaration
#Event Data
The FilterAppointment 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 Persistent |
#Remarks
You can handle the FilterAppointment event to hide specific appointments in the SchedulerControl. This event fires each time the layout of the scheduler control is modified (when the control is resized, 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 FilterAppointment event is raised for each appointment in the AppointmentStorage, in turn. If the PersistentObjectCancelEventArgs.Cancel parameter is set to true for the currently processed appointment, then this appointment will be hidden in the scheduler control.
NOTE
This event enables you to specify appointments for visualization. Do not modify appointment properties, and do not add or remove appointments within this event handler. Doing so may result in an unhandled exception.
#Examples
This example demonstrates how to use the SchedulerStorage.FilterAppointment event to filter appointments shown within a Scheduler Control according to specific conditions. Specifically, the code below hides all tentative appointments (those whose status is set to AppointmentStatusType.Tentative).
using DevExpress.XtraScheduler;
// ...
private void SchedulerStorage_FilterAppointment(object sender, PersistentObjectCancelEventArgs e) {
// Filter all tentative appointments.
e.Cancel = ((Appointment)e.Object).StatusId == 1;
}