Reputation: 2795
I have a list view with multiple fields, and the problem is that I can't get the value from columns other then the first one.
When I call lv.SelectedItems[0]
I get the first column, but everything other then 0 for index gives me this error: Additional information: InvalidArgument=Value of
1is not valid for
index.
Upvotes: 0
Views: 1186
Reputation: 101681
You are probably looking for SubItems
property:
var item = lv.SelectedItems[0];
var firstColumn = item.SubItems[0].Text;
var secondColumn = item.SubItems[1].Text;
...
Upvotes: 1