Getting Data from WinForms ListView Control

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-03-24T10:31:31Z Indexed on 2010/03/28 3:33 UTC
Read the original article Hit count: 642

Filed under:
|
|
|

I need to retrieve my data from a ListView control set up in Details mode with 5 columns.

I tried using this code:

MessageBox.Show(ManageList.SelectedItems(0).Text)

And it works, but only for the first selected item (item 0). If I try this:

MessageBox.Show(ManageList.SelectedItems(2).Text)

I get this error:

InvalidArgument=Value of '2' is not valid for 'index'. Parameter name: index

I have no clue how I can fix this, any help?

Edit: Sorry, should have said, I'm using Windows.Forms :)

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about listview