Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TimelineBar.AddTask(GanttControlNode) Method

Displays the specified task on the timeline bar.

Namespace: DevExpress.XtraGantt.TimeLine

Assembly: DevExpress.XtraGantt.v24.2.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