SchedulerControl.SelectedAppointments Property

Provides access to the collection of selected appointments.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v20.1.dll

Declaration

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

Property Value

Type Description
AppointmentBaseCollection

An AppointmentBaseCollection descendant which represents the collection of selected appointments.

Remarks

The SelectedAppointments property allows you to select specific appointments (by adding them to the returned collection) and 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

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); 
}
See Also