Back to Devexpress

SchedulerDataStorage.AppointmentsInserted Event

windowsforms-devexpress-dot-xtrascheduler-dot-schedulerdatastorage-819627d1.md

latest8.7 KB
Original Source

SchedulerDataStorage.AppointmentsInserted Event

Fires after one or several appointments have been added to the collection.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public event PersistentObjectsEventHandler AppointmentsInserted
vb
Public Event AppointmentsInserted As PersistentObjectsEventHandler

Event Data

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

PropertyDescription
ObjectsGets the persistent objects for which the event occurs.

Remarks

The AppointmentsInserted event serves as a notification that appointments have been added. The e.Objects event parameter allows you to obtain inserted appointments. To access appointments, you must cast e.Objects to AppointmentBaseCollection.

To validate appointment insertion, or decide whether an appointment can be added, handle the SchedulerDataStorage.AppointmentInserting event.

If you insert multiple appointments in code, and wrap this code in BeginUpdate \ EndUpdate method calls, the event fires only once.

Important

Do not modify the SchedulerDataStorage data (i.e., change the AppointmentCollection collection, the Appointment items, etc.) within this event handler. Otherwise, the declared changes might be lost and won’t take effect at runtime.

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppointmentsInserted 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.

winforms-scheduler-create-appointment-edit-form-with-custom-fields/CS/SimpleCustomFields/Form1.cs#L19

csharp
schedulerDataStorage1.AppointmentInserting += SchedulerStorage1_AppointmentInserting;
schedulerDataStorage1.AppointmentsInserted += new PersistentObjectsEventHandler(this.OnApptChangedInsertedDeleted);
schedulerDataStorage1.AppointmentChanging += SchedulerStorage1_AppointmentChanging;

winforms-scheduler-optimize-performance-large-dataset/CS/FetchAppointmentExample/Form1.cs#L27

csharp
schedulerDataStorage1.AppointmentsChanged += OnApptChangedInsertedDeleted;
schedulerDataStorage1.AppointmentsInserted += OnApptChangedInsertedDeleted;
schedulerDataStorage1.AppointmentsDeleted += OnApptChangedInsertedDeleted;

winforms-scheduler-custom-appointment-edit-form/CS/SchedulerDbExample/Form1.cs#L26

csharp
this.schedulerDataStorage1.AppointmentsChanged += OnAppointmentChangedInsertedDeleted;
this.schedulerDataStorage1.AppointmentsInserted += OnAppointmentChangedInsertedDeleted;
this.schedulerDataStorage1.AppointmentsDeleted += OnAppointmentChangedInsertedDeleted;

winforms-scheduler-linq-to-sql/CS/XtraScheduler_LINQ/Form1.cs#L45

csharp
this.schedulerStorage1.AppointmentsChanged += OnSchedulerStorage1AppointmentsChanged;
this.schedulerStorage1.AppointmentsInserted += OnSchedulerStorage1AppointmentsInserted;
this.schedulerStorage1.AppointmentDeleting += OnSchedulerStorage1AppointmentDeleting;

winforms-scheduler-bind-to-ms-sql-server/CS/SchedulerSQLRuntime/Form1.cs#L13

csharp
// Subscribe to Storage events required for updating the data source.
this.schedulerDataStorage1.AppointmentsInserted += OnApptChangedInsertedDeleted;
this.schedulerDataStorage1.AppointmentsChanged += OnApptChangedInsertedDeleted;

winforms-scheduler-create-appointment-edit-form-with-custom-fields/VB/SimpleCustomFields/Form1.vb#L21

vb
AddHandler schedulerDataStorage1.AppointmentInserting, AddressOf SchedulerStorage1_AppointmentInserting
AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentChanging, AddressOf SchedulerStorage1_AppointmentChanging

winforms-scheduler-optimize-performance-large-dataset/VB/FetchAppointmentExample/Form1.vb#L28

vb
AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted

winforms-scheduler-custom-appointment-edit-form/VB/SchedulerDbExample/Form1.vb#L28

vb
AddHandler Me.schedulerDataStorage1.AppointmentsChanged, AddressOf OnAppointmentChangedInsertedDeleted
AddHandler Me.schedulerDataStorage1.AppointmentsInserted, AddressOf OnAppointmentChangedInsertedDeleted
AddHandler Me.schedulerDataStorage1.AppointmentsDeleted, AddressOf OnAppointmentChangedInsertedDeleted

winforms-scheduler-linq-to-sql/VB/XtraScheduler_LINQ/Form1.vb#L47

vb
AddHandler schedulerStorage1.AppointmentsChanged, AddressOf OnSchedulerStorage1AppointmentsChanged
AddHandler schedulerStorage1.AppointmentsInserted, AddressOf OnSchedulerStorage1AppointmentsInserted
AddHandler schedulerStorage1.AppointmentDeleting, AddressOf OnSchedulerStorage1AppointmentDeleting

winforms-scheduler-bind-to-ms-sql-server/VB/SchedulerSQLRuntime/Form1.vb#L15

vb
' Subscribe to Storage events required for updating the data source.
AddHandler Me.schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler Me.schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted

See Also

AllowAppointmentCreate

AppointmentInserting

InitNewAppointment

SchedulerDataStorage Class

SchedulerDataStorage Members

DevExpress.XtraScheduler Namespace