Skip to main content

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.v14.2.dll

#Declaration

[Browsable(false)]
public TimeInterval SelectedInterval { get; }

#Property Value

Type Description
TimeInterval

A DevExpress.XtraScheduler.TimeInterval object that specifies the selected time interval.

#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