Scroll WinRT ListView to particular group

2019-08-05 17:13发布

I have a ListView and grouped items inside of it. User has different ways of navigating into the page, and according to the way he navigates, I wish to have a certain group in view when the page opens.

I tried setting these:

itemGridView.ScrollIntoView(....);
itemGridView.SelectedIndex = ....;
itemGridView.SelectedItem = ....;

where itemGridView is the name of the ListView, but none of that seems to work.

Any help appreciated, thanks.

1条回答
走好不送
2楼-- · 2019-08-05 17:55

You could do some visual tree traversing to find the ScrollViewer that is part of the ListView template, find the group and scroll the ScrollViewer to the position of your group.

查看更多
登录 后发表回答