I have a winforms listview with 200 items shown in a details listview.
50 items show at a time on the screen. I would like to hit a button and have the listview show the selected index # – for example #113.
The problem I’m having is that I can select index 113 but the listview will not show 113 at the top of the scroll range.
What do I have to do to get the listview to move to the selectindex?
UPDATE1:
The answer is to use EnsureVisible :
populateListView();
this.listView1.Items[113].Selected = true;
this.listView1.Items[113].EnsureVisible();
Did you try using
yourList.SelectedItem.EnsureVisibleUse
list.TopItem = list.Item[x]to have it scroll that item to the top (or attempt to)http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.ensurevisible%28VS.90%29.aspx