[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Collapse]Gantt Control
   [Expand]Getting Started
   [Expand]Bind to Data
   [Expand]Data Editing and Validation
    Item Types
    Task Dependencies
    Working and Non-Working Time Ranges
    Strip Lines
   [Expand]Visual Elements
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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)

Working and Non-Working Time Ranges

The GanttControl (see GanttControl) allows you to specify the following working and non-working time ranges:

  • working and non-working time (for example, breaks)

  • working and non-working days (for example, holidays, weekends)

This topic describes how to define working and non-working time ranges, and change their visibility and appearance.

Expanded Non-Working Time Range Visibility

The GanttControl provides the following properties that allow you to change the visibility of non-working time ranges in the Gantt area:

These properties return the following TimeIntervalDisplayMode enumeration values:

Property Description
TimeIntervalDisplayMode.Cut

The time intervals are cut out from the timeline.

TimeIntervalDisplayMode.Hide

The time intervals are not visually highlighted in the timeline.

TimeIntervalDisplayMode.Show

The time intervals are displayed and highlighted in the timeline.

Expanded Working and Non-Working Time Rules

The GanttControl stores its working time rules within the GanttView.WorkingTimeRules collection. This collection provides methods that allow you to add new and remove existing rules. Individual rules are represented by WorkingTimeRule objects.

Working time rules contain the following information:

The code sample below demonstrates how to define working time rules.

Expanded Working and Non-Working Day Rules

The GanttControl stores its workday rules within the WorkdayRules collection. This collection provides methods that allow you to add new and remove existing rules. Individual rules are represented by WorkdayRule objects.

Workday rules contain the following information:

The code sample below demonstrates how to define the working and non-working day rules.

Expanded Rule Recurrence

Working time and workday rules can reoccur multiple times. The GanttControl allows you to configure rule recurrence:

  • Daily

  • Weekly

  • Monthly

  • MonthlyByDayOfWeek

  • Yearly

  • YearlyByDayOfYear

  • YearlyByDayOfWeek

Expanded Appearance Customization

You can control the appearance of non-working time intervals displayed within the Gantt area.

Apply a style to the MarkedTimeControl to change the appearance of the highlighted non-working intervals.

The code sample below demonstrates how to change the color of non-working time intervals within the Gantt area.

The image below illustrates the result:

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