Skip to main content

SchedulerControl.SelectedInterval Property

Gets the time interval currently selected in the scheduler’s active view by an end-user.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v22.1.dll

NuGet Package: DevExpress.Win.Scheduler


public TimeInterval SelectedInterval { get; }

Property Value

Type Description

A TimeInterval object representing the selected time interval.


This example demonstrates how to create a new appointment for the time interval currently selected in the scheduler. 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.Appointments collection of the scheduler’s SchedulerControl.Storage.

View Example

// Delete all appointments.
// Select time interval
scheduler.ActiveView.SetSelection(new TimeInterval(DateTime.Now, new TimeSpan(2, 40, 0)), scheduler.ActiveView.GetResources()[1]);
// Group by resource.
scheduler.GroupType = SchedulerGroupType.Resource;
// Create a new appointment.
Appointment apt = scheduler.Storage.CreateAppointment(AppointmentType.Normal);

// Set the appointment's time interval to the selected time interval.
apt.Start = scheduler.SelectedInterval.Start;
apt.End = scheduler.SelectedInterval.End;

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

// Add the new appointment to the appointment collection.
See Also