Prafful Thakare

Prafful Thakare

  • NA
  • 41
  • 1.9k

I want to enter data in textbox after press enter datagrid

Mar 27 2015 10:04 AM
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();
     }

Answers (1)