Skip to main content
A newer version of this page is available. .

ASPxScheduler.WorkDays Property

Provides access to the collection which identifies which days are assigned to a workweek.

Namespace: DevExpress.Web.ASPxScheduler

Assembly: DevExpress.Web.ASPxScheduler.v19.1.dll

Declaration

public WorkDaysCollection WorkDays { get; }

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 others. The settings of the Work Week View are specified by the SchedulerViewRepository.WorkWeekView property.

By default, Monday, Tuesday, Wednesday, Thursday and Friday are considered workdays. The WorkDays property lets you set a different set of work days.

The following code snippet demonstrates how to set work week days to Monday, Tuesday and Wednesday. All the other week days will not be regarded as work 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.

ASPxScheduler1.WorkDays.BeginUpdate();
ASPxScheduler1.WorkDays.Clear();
ASPxScheduler1.WorkDays.Add(WeekDays.Monday);
ASPxScheduler1.WorkDays.Add(WeekDays.Wednesday);
ASPxScheduler1.WorkDays.Add(WeekDays.Friday);
ASPxScheduler1.WorkDays.EndUpdate();
See Also