I want to enter data in textbox after press enter datagrid
i am using this code to get customer id & name from datagridview which is working properly but for this i am clicking on rowheader. i cant understand how to get data from datagridview by pressing enter on specific row or cell. .
private void dgvCustomer_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
DataGridViewRow dr = dgvCustomer.SelectedRows[0];
lblCustId.Text = dr.Cells[0].Value.ToString();
txtCustName.Text = dr.Cells[1].Value.ToString();
dgvCustomer.Hide();
txtProductId.Focus();
}