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 Class

A timeline bar.

Namespace: DevExpress.XtraGantt.TimeLine

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