Skip to main content

SchedulerControl.SelectedAppointments Property

Gets the collection of selected appointments.

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v24.1.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