The duration of the task specifies how long the task will take to complete. To set task duration in GanttView, you can use Duration property of the Task class. Additionally, you can use the DurationUnits property which takes values from DurationUnits enumeration to set the duration unit to Minutes, Hours, Days, Weeks, or Months.
The following image showcases a GanttView task whose duration is set to 5 days.
To set the task duration in the GanttView to 5 days, use the following code. This example uses the sample created in Quick Start.
C# |
Copy Code
|
---|---|
//Set duration unit and duration of a task
t.DurationUnits= DurationUnits.Days;
t.Duration = 5;
|
Besides, task duration can be set at runtime through the Task Information dialog, which can be accessed by clicking the Task Information button from the Toolbar.