How do I scroll the chart view to a specific date?
Usually when bound to a data source (database, xml file, etc.), when the GanttControl loads, you want to ensure that the chart view is scrolled to the right position to display the tasks in the project. (Note that by default, the chart view's scroll position is anchored to DateTime.Today)
You can do so as follows:
// Retrieve the list of bound items
ObservableCollection<Tasks> taskItems = this.ganttControl.ItemsSource as ObservableCollection<Tasks>;
if (taskItems.Count > 0)
{
// Scroll the chart view to the first task's start date
this.ganttControl.GanttChart.AnchorTime = taskItems[0].StartDate;
}
� RadiantQ 2009 - 2019. All Rights Reserved.