Back to Devexpress

TimelineBar Class

windowsforms-devexpress-dot-xtragantt-dot-timeline.md

latest3.9 KB
Original Source

TimelineBar Class

A timeline bar.

Namespace : DevExpress.XtraGantt.TimeLine

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
public class TimelineBar
vb
Public Class TimelineBar

The following members return TimelineBar objects:

Remarks

Use the GanttControl.TimelineBars property to access a collection of timeline bars displayed on the timeline.

Use the GanttControl.AddTimelineBar and GanttControl.RemoveTimelineBar methods to add/remove timeline bars to/from the collection.

The following example demonstrates how to create a timeline bar and display it 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))

Tasks

Use the timeline bar’s Nodes property to access its tasks. The following methods allow you to manage the [TimelineBar.Nodes] collection:

Date Range

The date range of timeline bars matches the duration of the project. Use the TimelineBar.Options.StartDate and TimelineBar.Options.FinishDate properties to specify a custom date range.

You can also use the Gantt control’s SetTimelineBarRange method to specify a custom date range for a specific timeline bar.

Users can use a context menu to specify a custom date range for the focused timeline bar.

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

Inheritance

Object TimelineBar

See Also

Timeline

TimelineBar Members

DevExpress.XtraGantt.TimeLine Namespace