The Perfectionist
The Perfectionist

Reputation: 57

Focus On Listview last added Item

I am working on windows store app, where I am using ListView control to add data dynamically. The items are added at the end of the list. The Scrollbar appears when more data is added. 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.

Upvotes: 1

Views: 6407

Answers (2)

Han Tran
Han Tran

Reputation: 2093

Use this:

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

Upvotes: 0

SekaiCode
SekaiCode

Reputation: 1093

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

Upvotes: 5

Related Questions