Skip to main content

SchedulerControl.SelectedAppointments Property

Gets the collection of selected appointments.

Namespace: DevExpress.Xpf.Scheduler

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

Declaration

[Browsable(false)]
public AppointmentBaseCollection SelectedAppointments { get; }
<Browsable(False)>
Public ReadOnly Property SelectedAppointments As AppointmentBaseCollection

Property Value

Type Description
AppointmentBaseCollection

A DevExpress.XtraScheduler.AppointmentBaseCollection descendant which is the collection of selected appointments.

Remarks

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).

Examples

This example demonstrates how to copy the selected appointments to the following 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.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