Firstly, you may have already know you can make cell, row or column of
DataGridView select-able. In your case, make sure the DataGridView's
SelectionMode is set to RowHeaderSelect, or FullRowSelect.
Then, you can handle SelectionChanged event:
private void DataGridView1_SelectionChanged(...)
{
if (DataGridView1.SelectedRows.Count==0) return;
//Do something with the SelectedRows, it could be one row, or multiple
rows. For example:
Label1.Text=DataGridView1.SelectedRows[0].Cells[0].Value.ToString();
...
}
> Hello,
> I would like to take the values contained in columns of a selected row and
[quoted text clipped - 3 lines]
>
> Wnz
thewanz - 08 Feb 2008 17:16 GMT
Excellent! This works, thanks for the tip on the selection mode, too!
Cheers,
Wnz
> Firstly, you may have already know you can make cell, row or column of
> DataGridView select-able. In your case, make sure the DataGridView's
[quoted text clipped - 20 lines]
> >
> > Wnz