SchedulerControl.SelectedInterval Property

Gets the time interval currently selected in the Scheduler control's active view by an end-user.

Namespace: DevExpress.Xpf.Scheduler

Assembly: DevExpress.Xpf.Scheduler.v20.1.dll

Declaration

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

Property Value

Type Description
TimeInterval

A TimeInterval object representing the selected time interval.

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.

Examples

This example demonstrates how to create a new appointment for the time interval currently selected in a Scheduler control. Also, shows how to get a resource that contains the selected time interval, and set a resource's Id to the appointment. The selected time interval is accessed via the SchedulerControl.SelectedInterval property, and the selected resource is accessed via the SchedulerControl.SelectedResource property. An appointment is added to the SchedulerStorage.AppointmentStorage collection of the Scheduler's SchedulerControl.Storage.

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

// Create a new appointment.
Appointment apt = new Appointment();

// Set the appointment's time interval to the time interval
// currently selected by an end-user.
apt.Start = schedulerControl1.SelectedInterval.Start;
apt.End = schedulerControl1.SelectedInterval.End;

// Set the appointment's resource to the resource, which
// contains the currently selected time interval.
apt.ResourceId = schedulerControl1.SelectedResource.Id;

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