[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
   [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)

Task Dependencies

The GanttControl can show relationships between tasks. These relationships are called task dependencies. They indicate dependency criteria based on which tasks begin and end in relation to each other. For example, the FinishToStart dependency means that the second task may not start before the first task is finished.

The following task dependency types are available:

Expanded Retrieve Task Dependencies

In your data source, the task dependencies can be stored in any of the following ways:

  • Task dependencies are stored in a separate collection: each of the collection elements stores Successor-Predecessor pair.
  • Task dependencies are stored in the task objects: successor tasks store information about their predecessors.

The GanttControl supports both of them.

Expanded Retrieve Task Dependencies Stored in a Separate Collection

If you store task dependencies in a separate collection, the collection items should contain the following fields:

  1. predecessor task or its Id
  2. successor task or its Id
  3. task dependency type: a PredecessorLinkType enumeration value.

    If the task dependency type is not specified, the FinishToStart dependency type is used.

The code sample below demonstrates the data model that represents task dependencies.

To retrieve task dependencies from a data source, do the following:

  1. Bind the GanttView.PredecessorLinksSource property to a collection of task dependencies (exposed by the Dependencies ViewModel property in the code sample below).
  2. Specify the mappings to dependency objects using the GanttView.PredecessorLinkMappings property.

The code sample below illustrates a GanttControl bound to a data source and to a collection of task dependencies.

Expanded Retrieve Task Dependencies Stored in the Task Object

If you store task's dependencies in the task object, the collection items should contain the following fields:

  1. predecessor task or its Id
  2. task dependency type: a PredecessorLinkType enumeration value.

    If the task dependency type is not specified, the FinishToStart dependency type is used.

The code sample below demonstrates the data model that represents task dependencies.

If you store task's dependencies in the task object, the task object should provide access to a collection of task's dependencies, like in the code sample below:

To retrieve task dependencies from task objects, do the following:

  1. Provide a path to task dependency data field to the GanttView.PredecessorLinksPath property (exposed by the DependencyLinks task property in the code sample below).
  2. Specify the mappings to dependency objects using the GanttView.PredecessorLinkMappings property.

The code sample below illustrates a GanttControl bound to a data source and to a collection of task dependencies.

Using the Default Dependency Type (FinishToStart)

You can simplify your ViewModel if your tasks use only the FinishToStart dependency type.

In this case, your task objects should provide access to a collection of task predecessors (or their Id's), like in the code sample below.

To retrieve task dependencies from task objects, do the following:

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