scrollToColumn method

Future<void> scrollToColumn(
  1. double columnIndex, {
  2. bool canAnimate = false,
  3. DataGridScrollPosition position = DataGridScrollPosition.start,
})

Scrolls the SfDataGrid to the given column index.

If you want animation on scrolling, you can pass true as canAnimate argument.

Also, you can control the position of a row when it comes to view by passing the DataGridScrollPosition as an argument for position.

Implementation

Future<void> scrollToColumn(double columnIndex,
    {bool canAnimate = false,
    DataGridScrollPosition position = DataGridScrollPosition.start}) async {
  return scrollToCell(-1, columnIndex,
      canAnimate: canAnimate, columnPosition: position);
}