tags:

views:

673

answers:

2

hi,

i want to show the selected item in a list view automatically(it isn't possible to show all items without scrolling).

this.listView.SelectedIndex = 999; selects of course an item, but it doesn't show it.

what can i use to show it automatically ?

kind regards, jeff

A: 

Check out this one:
http://stackoverflow.com/questions/211971/scroll-wpf-listview-to-specific-line

Zyphrax
ScrollIntoView worked for me ;) thx
Jeffrey
A: 

This might help you, i'm not sure if it's what you're looking for but it brings the selected item into view and scrolls to it for you if necessary.

 int selectedIndex = listView.Items.IndexOf((listView.SelectedItems[0]))

 listView.Items[selectedIndex].EnsureVisible();
David Swindells