A newer version of this page is available. Switch to the current version.

WorkDaysCollection.Add(WeekDays) Method

Adds an item to the WorkDaysCollection if the collection does not contain the specified item.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v18.2.Core.dll


public int Add(
    WeekDays weekDays
Public Function Add(
    weekDays As WeekDays
) As Integer


Name Type Description
weekDays WeekDays

A WeekDays enumeration value.


Type Description

An integer, representing the position into which the new element was inserted.


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.Add(WeekDays.Monday | WeekDays.Tuesday | WeekDays.Wednesday);
See Also