Back to Devexpress

TimelineBar.AddTask(GanttControlNode) Method

windowsforms-devexpress-dot-xtragantt-dot-timeline-dot-timelinebar-dot-addtask-x28-devexpress-dot-xtragantt-dot-ganttcontrolnode-x29.md

latest2.8 KB
Original Source

TimelineBar.AddTask(GanttControlNode) Method

Displays the specified task on the timeline bar.

Namespace : DevExpress.XtraGantt.TimeLine

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
public void AddTask(
    GanttControlNode node
)
vb
Public Sub AddTask(
    node As GanttControlNode
)

Parameters

NameTypeDescription
nodeGanttControlNode

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.

csharp
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);
vb
Imports DevExpress.XtraGantt
Imports DevExpress.XtraGantt.TimeLine

' Creates a timeline bar and displays it on the timeline.
Private timelineBar As TimelineBar = ganttControl1.AddTimelineBar()
' Displays the focused task on the timeline bar.
timelineBar.AddTask(TryCast(ganttControl1.FocusedNode, GanttControlNode))

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

See Also

RemoveTask

RemoveSelectedTasks()

ClearTasks()

AddTaskToTimeline

TimelineBar Class

TimelineBar Members

DevExpress.XtraGantt.TimeLine Namespace