How can I use the DataGridView.CellClick
event to click on a single column?
The way I did it in my code if I click any part of the datagrid it does the action, and did not want it to be that way I want to click one and a specific column and perform the action.
Here is my event code:
private void DGW_chklist_CellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRow row = this.DGW_chklist.Rows[e.RowIndex];
this.txt_nota.Text = row.Cells[1].Value.ToString();
this.txt_cliente.Text = row.Cells[2].Value.ToString();
this.txt_transp.Text = row.Cells[3].Value.ToString();
this.txt_volume.Text = row.Cells[4].Value.ToString();
ncheklist();
if (txt_dtinicial.Text != "")
{
consultartransp();
}
else
{
MessageBox.Show("Erro");
}
}