Share via


ListView.ScrollTo Method

Definition

Overloads

ScrollTo(Object, Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item in the group

ScrollTo(Object, ScrollToPosition, Boolean)

Scrolls the ListView to the item.

ScrollTo(Object, Object, ScrollToPosition, Boolean)

Source:
ListView.cs
Source:
ListView.cs

Scrolls the ListView to the item in the group

public:
 void ScrollTo(System::Object ^ item, System::Object ^ group, Microsoft::Maui::Controls::ScrollToPosition position, bool animated);
public void ScrollTo (object item, object group, Microsoft.Maui.Controls.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * obj * Microsoft.Maui.Controls.ScrollToPosition * bool -> unit
Public Sub ScrollTo (item As Object, group As Object, position As ScrollToPosition, animated As Boolean)

Parameters

item
Object

The item from your ItemsSource to scroll to.

group
Object

The group from your ItemsSource to scroll to.

position
ScrollToPosition

How the item should be positioned on screen.

animated
Boolean

Whether or not the scroll should be animated.

Exceptions

position contains an invalid value for ScrollToPosition.

Remarks

A linear search is done for the item, so if the same reference appears multiple times in the group, the first item will be scrolled to. The same item in a different group will be ignored.

Applies to

ScrollTo(Object, ScrollToPosition, Boolean)

Source:
ListView.cs
Source:
ListView.cs

Scrolls the ListView to the item.

public:
 void ScrollTo(System::Object ^ item, Microsoft::Maui::Controls::ScrollToPosition position, bool animated);
public void ScrollTo (object item, Microsoft.Maui.Controls.ScrollToPosition position, bool animated);
member this.ScrollTo : obj * Microsoft.Maui.Controls.ScrollToPosition * bool -> unit
Public Sub ScrollTo (item As Object, position As ScrollToPosition, animated As Boolean)

Parameters

item
Object

The item from your ItemsSource to scroll to.

position
ScrollToPosition

How the item should be positioned on screen.

animated
Boolean

Whether or not the scroll should be animated.

Exceptions

position contains an invalid value for ScrollToPosition.

Remarks

A linear search is done for the item, so if the same reference appears multiple times in the list, the first item will be scrolled to. This includes if grouping is enabled.

Applies to