ListView - Scroll to last item automatically

G

Guest

Dear List,

I am using the ListView from CompactFramework. I populate the ListView with
the names of various items I download from the Internet.

As more items are added to the list it eventually reveals its vertical
scrollbar and the items at the bottom of the list are not visible. Is there a
way to have the list scroll automatically to the last added item so I can
visually see what is being added?

Thanks for any suggestions,
Dave
 
M

Marc Ambrosius

davebythesea said:
As more items are added to the list it eventually reveals its vertical
scrollbar and the items at the bottom of the list are not visible. Is
there a way to have the list scroll automatically to the last added
item so I can visually see what is being added?
Any time you add an item, you can call:
listView.EnsureVisible(listView.Items.Count - 1);

listView.Update();

Marc
 
G

Guest

Marc Ambrosius said:
Any time you add an item, you can call:
listView.EnsureVisible(listView.Items.Count - 1);

listView.Update();

Marc

Hi Marc,

Thanks very much, I'll try that!

David
 
Joined
Jul 30, 2012
Messages
1
Reaction score
0
Thank you man, I looked everywhere and a lot of people told that this can't be done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Prevent ellipses in listview item 0
ListView Question 2
question about listview 2
Custom Listview Sample 1
listview problem 1
ListView Scrollbars 1
ListView scrollbars 7
ListView Refresh and Update 1

Top