windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-82f3fde5.md
Occurs after one or more appointments have been deleted from the SchedulerDataStorage.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.dll
NuGet Package : DevExpress.Win.Scheduler
public event PersistentObjectsEventHandler AppointmentsDeleted
Public Event AppointmentsDeleted As PersistentObjectsEventHandler
The AppointmentsDeleted event's data class is PersistentObjectsEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Objects | Gets the persistent objects for which the event occurs. |
The AppointmentsDeleted event notifies that one or more appointments were removed from the SchedulerDataStorage. Use the e.Objects event parameter to obtain deleted appointments (DevExpress.XtraScheduler.Internal.Implementations.AppointmentItem).
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Internal.Implementations;
void SchedulerDataStorage_AppointmentsDeleted(object sender, PersistentObjectsEventArgs e)
{
// Create a list to store IDs of deleted appointments.
List<object> ids = new List<object>();
// Iterate through deleted appointments and collect their IDs.
foreach (AppointmentItem apt in e.Objects)
{
ids.Add(apt.Id);
}
// Update your underlying data source.
// For example, remove corresponding records from a database or in-memory collection.
// ...
}
If you delete multiple appointments in code and wrap this code in BeginUpdate \ EndUpdate method calls, the AppointmentsDeleted event fires only once.
Tip
Handle the SchedulerDataStorage.AppointmentDeleting event to conditionally cancel the deletion of specific appointments.
Warning
Do not modify the SchedulerDataStorage data (for example, the AppointmentCollection collection or individual appointment items) within the AppointmentsDeleted event handler. Changes made at this point may be overwritten or ignored, and may not take effect.
The following code snippets (auto-collected from DevExpress Examples) contain references to the AppointmentsDeleted event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
schedulerDataStorage1.AppointmentsChanged += new PersistentObjectsEventHandler(this.OnApptChangedInsertedDeleted);
schedulerDataStorage1.AppointmentsDeleted += new PersistentObjectsEventHandler(this.OnApptChangedInsertedDeleted);
winforms-scheduler-optimize-performance-large-dataset/CS/FetchAppointmentExample/Form1.cs#L28
schedulerDataStorage1.AppointmentsInserted += OnApptChangedInsertedDeleted;
schedulerDataStorage1.AppointmentsDeleted += OnApptChangedInsertedDeleted;
winforms-scheduler-custom-appointment-edit-form/CS/SchedulerDbExample/Form1.cs#L27
this.schedulerDataStorage1.AppointmentsInserted += OnAppointmentChangedInsertedDeleted;
this.schedulerDataStorage1.AppointmentsDeleted += OnAppointmentChangedInsertedDeleted;
}
winforms-scheduler-bind-to-ms-sql-server/CS/SchedulerSQLRuntime/Form1.cs#L15
this.schedulerDataStorage1.AppointmentsChanged += OnApptChangedInsertedDeleted;
this.schedulerDataStorage1.AppointmentsDeleted += OnApptChangedInsertedDeleted;
this.schedulerStorage1.AppointmentsInserted += OnAppointmentChangedInsertedDeleted;
this.schedulerStorage1.AppointmentsDeleted += OnAppointmentChangedInsertedDeleted;
AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted
winforms-scheduler-optimize-performance-large-dataset/VB/FetchAppointmentExample/Form1.vb#L29
AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerControl1.VisibleIntervalChanged, AddressOf schedulerControl1_VisibleIntervalChanged
winforms-scheduler-custom-appointment-edit-form/VB/SchedulerDbExample/Form1.vb#L29
AddHandler Me.schedulerDataStorage1.AppointmentsInserted, AddressOf OnAppointmentChangedInsertedDeleted
AddHandler Me.schedulerDataStorage1.AppointmentsDeleted, AddressOf OnAppointmentChangedInsertedDeleted
End Sub
winforms-scheduler-bind-to-ms-sql-server/VB/SchedulerSQLRuntime/Form1.vb#L17
AddHandler Me.schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted
AddHandler Me.schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted
winforms-scheduler-create-gantt-chart/VB/GanttExample/Form1.vb#L24
AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf schedulerDataStorage1_AppointmentsChanged
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf schedulerDataStorage1_AppointmentsDeleted
' #End Region ' #AppointmentEvents
See Also