Help / WLanguage / WLanguage functions / Controls, pages and windows / Gantt Chart functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Adds a task in a Gantt Chart column in a Table or TreeView Table control.
NewTask is GanttTask
// Configures the task
NewTask.ID = GetIdentifier()
NewTask.Row = 1
NewTask.Progress = 50
NewTask.StartDate = Today()
NewTask.DurationInDay = 1
NewTask.Title = "New task"
// Adds the task
GanttAddTask(COL_Gantt, NewTask)
GanttAddTask(<Gantt column> , <Task>)
<Gantt column>: Control name
Name of the Gantt Chart column (in a Table or TreeView Table control) to be used.
<Task>: GanttTask variable
Name of the GanttTask variable that describes the characteristics of the task to add.
  • The new task is added then it is displayed.
  • The task can be retrieved in a GanttTask variable by using GanttGetTask:
    <Variable name> <- GanttGetTask(<Gantt column>, <Identifier>)

where Identifier is the identifier of the task to retrieve.
For example:
// Modify a task
MyTask is GanttTask
MyTask <- GanttGetTask(COL_Gantt, "ID1")
MyTask.Progress = 70
MyTask.ProgressColor = LightGreen

As the task is retrieved by the <- operator, the modifications performed on the GanttTask variable will be automatically applied to the Gantt chart.
You also have the ability to retrieve a task by using the following syntax:
<Variable name> <- <Gantt column>["<Identifier>"]

For example:
t <- COL_Gantt["ID1"]
t.BackgroundColor = LightBlue
  • A WLanguage error occurs if the task has no identifier or if this identifier already exists.
Business / UI classification: UI Code
Component: wd290mdl.dll
Minimum version required
  • Version 19
This page is also available for…
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help