Skip to main content
A newer version of this page is available. .
All docs
V23.1

TimelineBar.AddTask(GanttControlNode) Method

Displays the specified task on the timeline bar.

Namespace: DevExpress.XtraGantt.TimeLine

Assembly: DevExpress.XtraGantt.v23.1.dll

NuGet Package: DevExpress.Win.Gantt

Declaration

public void AddTask(
    GanttControlNode node
)

Parameters

Name Type Description
node GanttControlNode

The task.

Remarks

The AddTask method adds the specified task to the TimelineBar.Nodes collection and displays the task on the timeline bar. The AddTask method does nothing if the specified task is already displayed on the timeline.

using DevExpress.XtraGantt;
using DevExpress.XtraGantt.TimeLine;

// Creates a timeline bar and displays it on the timeline.
TimelineBar timelineBar = ganttControl1.AddTimelineBar();
// Displays the focused task on the timeline bar.
timelineBar.AddTask(ganttControl1.FocusedNode as GanttControlNode);

Read the following topic for detailed information and examples: Timeline.

See Also