RadiantQ WPF Gantt
Dependency Lines
Previous Topic  Next Topic 

Dependency Lines


Yes, you can even render dependency lines between bars in FlexyGantt. The FlexyGantt doesn't enforce any times or constraints as mentioned already, but these dependency lines might help visualize some dependencies that you have between tasks in your model.


Dependency Information in your Model


You could use a data type like this represent dependency lines in your model:


DependencyInfo{ StartTask, EndTask, DependencyType }


The StartTask and EndTask should refer to objects in your model that represent tasks (bars in the chart area).

The DependencyType property should of this type:

    public enum DependencyType

    {

        FinishToStart,

        StartToStart,

        FinishToFinish,

        StartToFinish,

        None

    }

which is a type defined by Gantt. This allows you to define how you want the lines to be rendered between the Start and End task, but it's optional, in which case the usual FinishToStart approach will be used.


Then create a list of DependencyInfo instances and bind it to the gantt as follows:


this.fxgantt.DependencyListSource = dependencyInfoList;


Specifying Binding in XAML


Assuming each row is represented by an Employee with these properties:


Employee {EName, EmployeeTasks }


where EmployeeTasks is a list of type Task:


Task{ TaskName, StartTime, EndTime, Employee}


where Employee represents the Employee owner instance that owns this task.


Then in XAML you can specify these bindings to let the gantt automatically figure out the relationships and render the dependency lines:


<fxgantt:FlexyGantt ..................

                           DependencyLineStartRowItemBinding="{Binding StartTask.Employee}"

                           DependencyLineEndRowItemBinding="{Binding EndTask.Employee}"

                           DependencyLineStartItemBinding="{Binding StartTask}"

                           DependencyLineEndItemBinding="{Binding EndTask}"

                           DependencyLineTypeBinding="{Binding DependencyType}"

                           >


Here is a sample FlexyGantt with dependency lines between tasks:

FlexyGantt with dependency lines


This is illustrated in this sample: ...\Samples\FlexyGantt\Appearance\FlexyGanttWithDepLines




� RadiantQ 2009 - 2019. All Rights Reserved.