PC Review


Reply
Thread Tools Rate Thread

ListView - Scroll to last item automatically

 
 
=?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?=
Guest
Posts: n/a
 
      21st Aug 2007
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
 
Reply With Quote
 
 
 
 
Marc Ambrosius
Guest
Posts: n/a
 
      21st Aug 2007
davebythesea wrote:
> 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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?=
Guest
Posts: n/a
 
      21st Aug 2007


"Marc Ambrosius" wrote:

> davebythesea wrote:
> > 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


Hi Marc,

Thanks very much, I'll try that!

David
 
Reply With Quote
 
=?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?=
Guest
Posts: n/a
 
      21st Aug 2007
Worked nicely, thanks!
 
Reply With Quote
 
New Member
Join Date: Jul 2012
Posts: 1
 
      30th Jul 2012
Thank you man, I looked everywhere and a lot of people told that this can't be done.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help coloring individual listview item instead of all listview item in visual c++ tonyck Webmaster / Programming 0 7th Jul 2006 11:06 AM
Scroll to last item in listview David Microsoft VB .NET 1 17th Feb 2005 02:57 PM
Highlighting a ListView item when the ListView does not have focus Rookie Microsoft C# .NET 3 13th Jul 2004 07:58 PM
How can I get a listview to auto scroll down to the last item entered (n/t) Jay Microsoft VB .NET 2 3rd Jun 2004 08:09 AM
Listview Item.Selected not populating Listview.SelectedItems collection Chris Adams Microsoft Dot NET Framework Forms 0 23rd Apr 2004 01:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.