Scrolling in UWP Gantt Chart
Scroll to visible region
The BringTaskOnVerticalScroll property enables you to scroll to the visible task region when the Chart is vertically scrolled.
The following code sample demonstrates how to enable the BringTaskOnVerticalScroll property.
<gantt:SfGantt ItemsSource="{Binding TaskCollection}" BringTaskOnVerticalScroll="True" >
</gantt:SfGantt>SfGantt sfGantt = new SfGantt();
sfGantt.ItemsSource = (this.DataContext as ProjectTrackerViewModel).TaskCollection;
sfGantt.BringTaskOnVerticalScroll = True;Scroll to particular region
You can scroll the UWP Gantt Chart programmatically using the ScrollGanttTo method. This method is only available from code-behind; it cannot be invoked from XAML.
The following parameters allow users to scroll the UWP Gantt Chart programmatically:
-
Date: Specifies date to scroll horizontally. -
Index: Specifies row index to scroll vertically.
SfGantt sfGantt = new SfGantt();
sfGantt.ItemsSource = (this.DataContext as ProjectTrackerViewModel).TaskCollection;
sfGantt.ScrollGanttTo(new DateTime(2014, 3, 1), 2);