0

I have a 3 column ListView. I'm having a hard time trying to gather a specific column in the selected rows of the ListView.

I'm trying to do this, but its going through each SubItem of a row.

foreach (ListViewItem.ListViewSubItem lvi in lvScanRepository.FocusedItem.SubItems)
            {
                string selPath = Path.Combine(_savePath, lvi.Text);
                if (File.Exists(selPath))
                    System.Diagnostics.Process.Start(selPath);
            }
1
  • 1
    And what should your code do instead? Commented Sep 23, 2009 at 7:51

1 Answer 1

2

If you know the specific column index, then you can just go:

listView1.SelectedItems[N].SubItems[X].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.