Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

NuGet Package: DevExpress.Win.Scheduler

#Declaration

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

#Property Value

Type Description
TimeInterval

A TimeInterval object representing the selected time interval.

#Example

This example creates a new appointment for the selected time interval and resource on a button click.

  1. Use the AppointmentDataStorage.CreateAppointment method to create a new appointment.
  2. Use the SchedulerControl.SelectedInterval property to get the selected time interval. Assign the interval’s start and end values to Appointment.Start and Appointment.End properties.
  3. Use the SchedulerControl.SelectedResource property to get the selected resource. Assign this value to the Appointment.ResourceId property.
  4. Add the appointment to the SchedulerStorage.Appointments collection.
void simpleButton1_Click(object sender, EventArgs e) {
  // Create a new appointment.
  Appointment apt = scheduler.DataStorage.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 that contains
  // the selected time interval.
  apt.ResourceId = scheduler.SelectedResource.Id;

  // Add the appointment to the appointment collection.
  scheduler.DataStorage.Appointments.Add(apt);
}

WinForms Scheduler Control - Create an Appointment for the Selected Time Interval and Resource, DevExpress

See Also