简体   繁体   English

关注Listview最后添加的项目

[英]Focus On Listview last added Item

I am working on windows store app, where I am using ListView control to add data dynamically. 我正在使用Windows Store应用程序,正在使用ListView控件动态添加数据。 The items are added at the end of the list. 这些项目将添加到列表的末尾。 The Scrollbar appears when more data is added. 添加更多数据时,将显示Scrollbar I want to highlight last added item programatically with scroll bar at the bottom. 我想通过底部的滚动条以编程方式突出显示最后添加的项目。 I don't want to scroll the scroll bar manually to see last added item. 我不想手动滚动滚动条以查看最后添加的项目。 How can I do this? 我怎样才能做到这一点? Thanks. 谢谢。

        listView1.EnsureVisible(listView1.Items.Count - 1);

用这个:

yourListView.ScrollIntoView(yourListView.Items[yourListView.Items.Count - 1]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM