SchedulerControl.WorkDays Property
Provides access to the collection which identifies which days are assigned to a workweek.
Namespace: DevExpress.XtraScheduler
Assembly: DevExpress.XtraScheduler.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
WorkDaysCollection | A WorkDaysCollection object which identifies work days. |
Remarks
The WorkDays object identifies which week days are workdays. This information is used by the Work Week View, which by default displays only workdays and doesn’t display the other days. The settings of the Work Week View are specified by the SchedulerViewRepository.WorkWeekView property.
By default, Monday, Tuesday, Wednesday, Thursday and Friday are regarded as week workdays. The WorkDays property lets you set a different set of work days.
Example
The following example demonstrates how to set week work days to Monday, Tuesday and Wednesday. All the other week days will not be regarded as working days and therefore will not be displayed within the WorkDays View.
The BeginUpdate and EndUpdate method pair is mandatory when adding or removing items of the SchedulerControl.WorkDays
collection. This technique ensures that the SchedulerControl displays specified workdays and prevents excessive change notifications from being sent. The SchedulerControl will not receive any change notifications until the EndUpdate method is invoked, and then only a single change notification will be sent.
schedulerControl1.WorkDays.BeginUpdate();
schedulerControl1.WorkDays.Clear();
schedulerControl1.WorkDays.Add(WeekDays.Monday | WeekDays.Tuesday | WeekDays.Wednesday);
schedulerControl1.WorkDays.EndUpdate();
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the WorkDays 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.