How to Set Selected Index for Listview

  • Thread starter Thread starter Steve Murphy
  • Start date Start date
S

Steve Murphy

Is there a way to set a selected index for a Listview in a WinForms
application?

Thanks in advance,
Steve Murphy
 
Steve said:
Is there a way to set a selected index for a Listview in a WinForms
application?

Thanks in advance,
Steve Murphy

ListView1.Items[<***YourIndex***>].Selected = true;

Good luck,
Andrey
 
Steve,

Are you asking about the items collection? If you are you can do something
like:

listView1.Items[1].Selected = true;

If this is not what you are asking about please repost with more specific
details.

Hope this helps.
 
Brian Brown said:
Are you asking about the items collection? If you are you can do something
like:

listView1.Items[1].Selected = true;

If this is not what you are asking about please repost with more specific
details.


Thanks. That did the trick. As I said to Andrey, I don't know how I
overlooked it the docs.

Anyway, I've pretty much got what I want working.

Thanks again,
Steve Murphy
 
Back
Top