corelibraries-devexpress-dot-xtrascheduler-dot-appointment-e862e115.md
Gets or sets the duration of the appointment.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.Core.dll
NuGet Package : DevExpress.Scheduler.Core
TimeSpan Duration { get; set; }
Property Duration As TimeSpan
| Type | Description |
|---|---|
| TimeSpan |
A TimeSpan value representing the duration of the appointment.
|
The Duration property and the Appointment.Start property specify the value of the Appointment.End property for the appointment. This value is always calculated as End = Start + Duration.
Note
The Ticks property value of the Duration should be greater than or equal to 0.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Duration property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-scheduler-create-appointments-on-reminder-alert/CS/ReminderCustomActions/Form1.cs#L52
app.Start = e.AlertNotifications[0].ActualAppointment.Start.AddHours(2);
app.Duration = TimeSpan.FromHours(4);
schedulerDataStorage1.Appointments.Add(app);
winforms-scheduler-drag-drop-appointments-from-grid/CS/T179722/Form1.cs#L90
Start = DateTime.MinValue,
Duration = apt.Duration,
LabelKey = (int)apt.LabelKey,
newAppointment.Start = ASPxScheduler1.SelectedInterval.Start;
newAppointment.End = newAppointment.Start + sourceAppointment.Duration;
winforms-scheduler-create-appointments-on-reminder-alert/VB/ReminderCustomActions/Form1.vb#L54
app.Start = e.AlertNotifications(0).ActualAppointment.Start.AddHours(2)
app.Duration = TimeSpan.FromHours(4)
schedulerDataStorage1.Appointments.Add(app)
winforms-scheduler-drag-drop-appointments-from-grid/VB/T179722/Form1.vb#L77
Dim apt = aptInfo.EditedAppointment
exchangeList.Add(New T179722.AppointmentExchangeData() With {.Subject = apt.Subject, .Description = apt.Description, .Start = System.DateTime.MinValue, .Duration = apt.Duration, .LabelKey = CInt(apt.LabelKey), .StatusKey = CInt(apt.StatusKey)})
Next
newAppointment.Start = ASPxScheduler1.SelectedInterval.Start
newAppointment.End = newAppointment.Start + sourceAppointment.Duration
ASPxScheduler1.Storage.Appointments.Add(newAppointment)
See Also