views:

188

answers:

2

What I have going on is a listview inside of my windows form.

How can I make so that only when you double click a row it pulls data for row X and column 3.

meaning I have a listview of...

A|B|C|D
1|2|3|4
@|#|$|%
Bc|Dv|D#|dg

so if i double clicked row thats begins with @ it will read in column 3 ($).

I aleady have FullRowSelect = True

I figured this out thanks everyone!

string hyperurl = listView1.FocusedItem.SubItems[2].Text;

+1  A: 

Use this code for your ListView's DoubleClick event:

private void listView1_DoubleClick(object sender, EventArgs e)
{
    if (listView1.SelectedItems.Count > 0)
    {
        ListViewItem item = listView1.SelectedItems[0];
        MessageBox.Show(item.SubItems[2].ToString());
    }
}
MusiGenesis