All docs
V20.1
20.2 (EAP/Beta)
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

GanttControl.WorkWeek Property

Provides access to a rule that specifies work hours for a workweek.

Namespace: DevExpress.XtraGantt

Assembly: DevExpress.XtraGantt.v20.1.dll

Declaration

[DXCategory("Behavior")]
public WorkWeekRule WorkWeek { get; }
<DXCategory("Behavior")>
Public ReadOnly Property WorkWeek As WorkWeekRule

Property Value

Type Description
WorkWeekRule

An object that specifies work hours for a workweek.

Remarks

The WorkWeek property provides access to the workweek schedule. The default workweek is from Monday to Friday. Work hours are 8:00 to 17:00 with a break between 12:00 and 13:00.

To customize the schedule in the Visual Studio Designer, click Edit Work Week Schedule in the control's smart tag menu (or click Run Designer and navigate to the Work Week Schedule section). You can specify the schedule for each day of the week.

The upper bound is not included in the working hours. For example, if the working time is until noon, 12:00 PM is not working time, but the time a moment (tick) earlier, remains the working time.

NOTE

The specified work hours are automatically sorted. If the specified work hours overlap each other, they are automatically merged.

Examples

The code below shows how to change work hours for Wednesday and make Monday a day off.

// Add Monday as a non-work day.
ganttControl1.WorkWeek.Add(new WorkDayOfWeek(DayOfWeek.Monday, true));

// Work hours for Wednesday are 9:00 to 17:30
// with a break between 12:00 and 13:30.
WorkTime wednesdayMorningWorkTime = new WorkTime(9, 12);
WorkTime wednesdayAfternoonWorkTime = new WorkTime(new TimeSpan(13, 30, 00), new TimeSpan(17, 30, 00));
WorkDayOfWeek wednesday = new WorkDayOfWeek(DayOfWeek.Wednesday, wednesdayMorningWorkTime, wednesdayAfternoonWorkTime);
ganttControl1.WorkWeek.Add(wednesday);
See Also