Reputation: 1515
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
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