DurationEdit Class
The combo box control used to specify time intervals (durations).
Namespace: DevExpress.XtraScheduler.UI
Assembly: DevExpress.XtraScheduler.v18.1.dll
Declaration
[ComVisible(false)]
[ToolboxTabName("DX.18.1: Scheduling")]
[ToolboxBitmap(typeof(SchedulerControl), "Bitmaps256.durationEdit.bmp")]
public class DurationEdit :
ComboBoxEdit
Remarks
The DurationEdit control provides the capability to choose a duration from a list of predefined intervals from 5 minutes to 2 days, or enter a custom interval. The control parses the entered string using HumanReadableTimeSpanHelper.ParseString method. You can enter a string composed of figures and predefined words, and it will be properly interpreted and converted to the TimeSpan value.
The following words are recognized by default:
- Minutes: “m”, “min”, “minute” “minutes”
- Hours: “h”, “hour”, “hours”
- Days: “d”, “day”, “days”
- Weeks: “w”, “week”, “weeks”
- Month: “month”, “months”
- Year: “year”, “years”
A list of accepted words signifying names of time intervals and their abbreviations is contained within localized resources. It is represented by the SchedulerStringId enumeration values - those starting with “Abbr..”, e.g. SchedulerStringId.Abbr_Minute, SchedulerStringId.Abbr_Minutes, SchedulerStringId.Abbr_HoursShort, SchedulerStringId.Abbr_Hour and so on.
Use the DurationEdit.LoadDefaults method to set the upper limit on editor values loaded by default.
The DurationEdit.Duration property reflects the time interval selected by the user.
The common appearance of the control is shown below.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DurationEdit class.
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.