Skip to main content
All docs
V25.1
  • TimelineBar.AddTask(GanttControlNode) Method

    Displays the specified task on the timeline bar.

    Namespace: DevExpress.XtraGantt.TimeLine

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