SchedulerDataStorage.AppointmentsDeleted Event
Occurs after one or more appointments have been deleted from the SchedulerDataStorage
.
Namespace: DevExpress.XtraScheduler
Assembly: DevExpress.XtraScheduler.v25.1.dll
NuGet Package: DevExpress.Win.Scheduler
Declaration
Event Data
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. |
Remarks
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.
Related GitHub Examples
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.