Another question about the listview control

D

Dom

how do I programmatically select an item in the listview item? In the
Listbox, I would just do "ListBox1.SelectedIndex = x". But the only
thing similar in the listview is the SelectedIndices Collection, and
that is "get" only.
 
B

Bond

D

Dom

Hi Dom,

That's because you can select many of them.

e.g. listView.Items[1].Selected = true;

Regards, Alex
[TechBlog]http://devkids.blogspot.com
how do I programmatically select an item in the listview item? In the
Listbox, I would just do "ListBox1.SelectedIndex = x". But the only
thing similar in the listview is the SelectedIndices Collection, and
that is "get" only.

Thanks, Alex. Don't know why I didn't guess that.
 
N

newscorrespondent

You need to select from the items collection something like

Listview.items[index].select = true;

It is possible to have more than one selected item.

Tom Groszko
 

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

Top