Dahevos
Dahevos

Reputation: 1515

Change gridView position WinRT Xaml

How can I move the position displayed into a GridView ?

On Windows 8 with WinRT.

I try the method ScrollIntoView of my gridview but seems doesn't work.

Upvotes: 1

Views: 854

Answers (1)

chue x
chue x

Reputation: 18803

Just taking a guess here, but you have to wait until the grid is loaded before you can call the ScrollIntoView method.

Sample code:

public MyPageConstructor()
{
    this.InitializeComponent();
    this.itemGridView.Loaded += (s,e) => itemGridView_Loaded(s, e);
}

private void itemGridView_Loaded(object sender, RoutedEventArgs e)
{
    var myobject = // get object
    this.itemGridView.ScrollIntoView(myobject);
}

Upvotes: 5

Related Questions