2013年5月12日 星期日

[Windows 8] How to set the Item to bring into view with ListView in Windows Store app

You can use the following function:

Scrolls the list to bring the specified data item into view.
public void ScrollIntoView(
    object item
)

Parameters

item
          Type: System.Object [.NET] | Platform::Object [C++]
          The data item to bring into view.

Sample

    int nPos = 5;  
    listView.ItemsSource = list;
    listView.UpdateLayout();
    listView.ScrollIntoView(list[nPos]);

沒有留言:

張貼留言