[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Collapse]Gantt Control
    Overview
    Data Source
    Tree and Chart Areas
    Tasks, Milestones, Dependencies
    Timescale
    Workweek Schedule and Exceptions
    View Options and Appearances
    Ribbon Commands
    Localization
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Workweek Schedule and Exceptions

Expanded Workweek Schedule

The GanttControl.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.

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

Expanded Exceptions

The GanttControl.Exceptions property — provides access to rules that specify exceptions to the regular workweek schedule. You can specify the following exceptions:

  • DailyExceptionRule — Represents a rule that specifies an exception that reoccurs every day.
  • WeeklyExceptionRule — Represents a rule that specifies an exception that reoccurs every week on a particular day of the week.
  • MonthlyExceptionRule — Represents a rule that specifies an exception that reoccurs every month on a particular day of the month.
  • MonthlyDayOfWeekExceptionRule — Represents a rule that specifies an exception that reoccurs every month in a particular week of the month and day of the week.
  • YearlyExceptionRule — Represents a rule that specifies an exception that reoccurs every year in a particular month and day of the month.
  • YearlyDayOfWeekExceptionRule — Represents a rule that specifies an exception that reoccurs every year in a particular month, week of the month, and day of the week.
  • YearlyDayOfYearExceptionRule — Represents a rule that specifies an exception that reoccurs every year on a particular day of the year.

To customize exceptions in the Visual Studio Designer, click Edit Exceptions in the control's smart tag menu (or click Run Designer and navigate to the Exceptions section).

The code below shows how to specify custom exception rules.

The code below shows how to specify holidays.

Note

Run the Gantt demo to see the complete example.

Is this topic helpful?​​​​​​​