Scrolling in UWP Gantt (SfGantt)

10 May 20211 minute to read

Scroll to visible region

The BringTaskOnVerticalScroll property in the SfGantt enables you scroll to the visible task region when the Gantt 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 Gantt chart programmatically using the ScrollGanttTo method.

The following parameters allow users to scroll the 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);