Mitt Rodenbaugh
Mitt Rodenbaugh

Reputation:

C#: How do you tell which item index is selected in ListView?

C#: How do you tell which item index is selected in ListView?

Upvotes: 2

Views: 9333

Answers (3)

Nathan W
Nathan W

Reputation: 55512

ListView mylistv = new ListView();
var index = mylistv.SelectedIndices();

That should do it.

Upvotes: 4

Cristian Libardo
Cristian Libardo

Reputation: 9258

Have you tried SelectedIndices?

myListView.SelectedIndices

Upvotes: 2

Tim Merrifield
Tim Merrifield

Reputation: 6268

Use the SelectedIndex property of the class.

Upvotes: 1

Related Questions