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 |
---|---|
Appointment |
A Appointment |
#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.
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);
}