By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,375 Members | 1,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,375 IT Pros & Developers. It's quick & easy.

Set selected item in listview

P: n/a
H

how can I SET the selected item in a listview control

Thank
Sam
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ListView.Items(index).Selected=true;

Note: By default, ListView.HideSelection is set True, so unless the listview
has focus, the selected ListViewItem is not highlighted.

"Sam Johnson" <an*******@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
Hi

how can I SET the selected item in a listview control?
Thanks
Sam

Jul 21 '05 #2

P: 1
It can be also useful if you add this line after selecting the item:
ListView.Items(index).EnsureVisible();

This will scroll the ListView (if necessary) to show selected item.
Sep 27 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.