windowsforms-devexpress-dot-xtragantt-dot-ganttcontrol-695d384d.md
Gets a collection of timeline bars displayed on the timeline.
Namespace : DevExpress.XtraGantt
Assembly : DevExpress.XtraGantt.v25.2.dll
NuGet Package : DevExpress.Win.Gantt
[DXCategory("Timeline")]
[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, true, true, 12000, XtraSerializationFlags.DefaultValue)]
public TimelineBarCollection TimelineBars { get; protected set; }
<XtraSerializableProperty(XtraSerializationVisibility.Collection, True, True, True, 12000, XtraSerializationFlags.DefaultValue)>
<DXCategory("Timeline")>
Public Property TimelineBars As TimelineBarCollection
| Type | Description |
|---|---|
| DevExpress.XtraGantt.TimeLine.TimelineBarCollection |
The collection of timeline bars.
|
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);
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))
Read the following topic for detailed information and examples: Timeline.
See Also