Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Obtain Selected Appointments

The following example demonstrates how to copy selected appointments to the next month. A copy of an existing appointment is created via the Appointment.Copy method. When a new appointment is created, its start time is increased by one month.

using DevExpress.XtraScheduler;
// ...

// Loop through all the selected appointments.
for(int i = 0; i < schedulerControl1.SelectedAppointments.Count; i++) {
   Appointment apt = schedulerControl1.SelectedAppointments[i];

   // Create new appointment using copy operation.
   Appointment newApt = apt.Copy();

   // Add one month to the new appointment's start time.
   newApt.Start = apt.Start.AddMonths(1);

   // Add new appointment to the appointment collection.
   schedulerControl1.Storage.Appointments.Add(newApt); 
}