0

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 of1is not valid forindex.

1 Answer 1

1

You are probably looking for SubItems property:

var item = lv.SelectedItems[0];

var firstColumn = item.SubItems[0].Text;
var secondColumn = item.SubItems[1].Text;
...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.