Skip to main content
All docs
V24.1

TimelineBar Class

A timeline bar.

Namespace: DevExpress.XtraGantt.TimeLine

Assembly: DevExpress.XtraGantt.v24.1.dll

NuGet Package: DevExpress.Win.Gantt

Declaration

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.

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);

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