Could anyone please help with this?
I have a DataGridView with three columns and one button column.
If I click on the button column, then all values in that row should be transferred to another form.
Note : I have already implemented the following click event handler:
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
}
Is there an alternative other than using the cell click event?
Many Thanks…..
Try the CellContentClick event.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellcontentclick.aspx
Edit: The CellContentClick event provides a DataGridViewCellEventArgs parameters, which contains the exact column and row clicked. From that link I provided, I can put together a short example. I’m assuming the values you want to pass are strings and are in columns 2, 3 and 4 (indexes 1, 2 and 3, respectively). Note, this isn’t tested!