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.SetTimelineVisibleRange(DateTime, DateTime) Method

Sets a visible date range for the timeline.

Namespace: DevExpress.XtraGantt

Assembly: DevExpress.XtraGantt.v24.2.dll

NuGet Package: DevExpress.Win.Gantt

#Declaration

public void SetTimelineVisibleRange(
    DateTime start,
    DateTime finish
)

#Parameters

Name Type Description
start DateTime

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.

ganttControl1.SetTimelineVisibleRange(new DateTime(2023, 5, 1), new DateTime(2023, 12, 1));

The image below shows the result:

Timeline Visible Date Range - WinForms Gantt Control

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