Back to Devexpress

GanttControl.SetTimelineVisibleRange(DateTime, DateTime) Method

windowsforms-devexpress-dot-xtragantt-dot-ganttcontrol-dot-settimelinevisiblerange-x28-system-dot-datetime-system-dot-datetime-x29.md

latest2.3 KB
Original Source

GanttControl.SetTimelineVisibleRange(DateTime, DateTime) Method

Sets a visible date range for the timeline.

Namespace : DevExpress.XtraGantt

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
public void SetTimelineVisibleRange(
    DateTime start,
    DateTime finish
)
vb
Public Sub SetTimelineVisibleRange(
    start As Date,
    finish As Date
)

Parameters

NameTypeDescription
startDateTime

The start date.

| | finish | DateTime |

The finish date.

|

Remarks

The date range of timeline matches the duration of the project. The SetTimelineVisibleRange method to specify a custom visible date range.

csharp
ganttControl1.SetTimelineVisibleRange(new DateTime(2023, 5, 1), new DateTime(2023, 12, 1));
vb
ganttControl1.SetTimelineVisibleRange(New Date(2023, 5, 1), New Date(2023, 12, 1))

The image below shows the result:

Users can hold Ctrl and use the mouse wheel to change the visible date range.

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

See Also

GetTimelineStartDate()

GetTimelineFinishDate()

GanttControl Class

GanttControl Members

DevExpress.XtraGantt Namespace