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

GanttControl.TimelineBars Property

Gets a collection of timeline bars displayed on the timeline.

Namespace: DevExpress.XtraGantt

Assembly: DevExpress.XtraGantt.v24.2.dll

NuGet Package: DevExpress.Win.Gantt

#Declaration

[DXCategory("Timeline")]
[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, true, true, 12000, XtraSerializationFlags.DefaultValue)]
public TimelineBarCollection TimelineBars { get; protected set; }

#Property Value

Type Description
DevExpress.XtraGantt.TimeLine.TimelineBarCollection

The collection of timeline bars.

#Remarks

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

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

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