Chart Runtime Customization
- 2 minutes to read
The VCL Gantt control allows users to add tasks at runtime, create relationships between them and customize all these elements using the task sheet or built-in dialogs.
Call the control’s LoadFromFile procedure and load a Gantt Chart from the “SoftDev” XML file shipped with the control’s demo:
procedure MyForm.FormCreate(Sender: TObject);
begin
dxGanttControl1.LoadFromFile('C:\Users\Public\Documents\DevExpress\VCL\Demos\ExpressGantt Control\Data\SoftDev.xml');
end;
Select a task or summary task in the chart and use one of the following techniques to open the “Task Information” or “Summary Task Information” dialogs:
Double click the task.
Right-click the task and select “Information…” in the context menu.
These dialogs allow users to modify the task name, completion percentage, duration, etc.
Add Tasks
Users can insert tasks into a project. To do this, they should right-click an empty row in the sheet and select “Insert Task” in the invoked context menu, or press the Insert key. This creates an empty task. Users should then specify the task duration in the corresponding sheet column to display the task as a horizontal bar in the chart.
Users can convert a task to a milestone or summary task.
Milestone. Select a task and input 0 in the “Duration” sheet column or in the same field in the “Task Information” dialog.
Summary task. Ensure that the task you want to make a summary task has successors. Press Shift+Alt+Right Arrow to indent the task that follows the task you want to make a summary task.
The target task becomes a summary task. Do the following to group tasks below with this summary:
Select the task you want to group.
Press Alt+Shift+ →+ →.
Adjust Dependencies
Project tasks are linked with relationships that specify when a task should begin or end in relation to other tasks. These relationships are referred to as dependencies. Dependencies appear as arrows that link tasks.
To link tasks, users should hover the mouse pointer over the task they wish to assign as the predecessor and drag the connector to the successor task. This creates the “Finish-To-Start” dependency.
Users can modify a dependency type or set its delay (in days) in the “Task Dependency” dialog. They should double-click a dependency to invoke the dialog.