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

SchedulerControl.SelectedAppointments Property

Gets the collection of selected appointments.

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v24.2.dll

NuGet Package: DevExpress.Wpf.Scheduler

#Declaration

[Browsable(false)]
public AppointmentBaseCollection SelectedAppointments { get; }

#Property Value

Type Description
AppointmentBaseCollection

A AppointmentBaseCollection descendant which represents the collection of selected appointments.

#Remarks

Important

You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.

The SelectedAppointments property allows you to get the appointments which are currently selected. The selected appointments can then be processed in a specific manner (for instance, they can be deleted or copied to a different time slot).

#Example

This example demonstrates how to copy the selected appointments to the next month. A copy of an existing appointment is created via the Appointment.Copy method. After a new appointment has been created, its start time is increased by one month via the Appointment.Start property.

using DevExpress.Xpf.Scheduler;
using DevExpress.XtraScheduler;
// ...

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

   // Copy the current appointment.
   Appointment newApt = apt.Copy();

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

   // Add the new appointment to the appointment collection.
   schedulerControl1.Storage.AppointmentStorage.Add(newApt); 
}
See Also