i have written the following codes but it shows the previous records in text boxes.
private void dataGridViewkala_KeyDown(object sender, KeyEventArgs e)
{
txtkalacode.Text = dataGridViewkala.CurrentRow.Cells[0].Value.ToString();
txtkalaname.Text = dataGridViewkala.CurrentRow.Cells[1].Value.ToString();
txtkqty.Text = dataGridViewkala.CurrentRow.Cells[2].Value.ToString();
txtkalapoint.Text = dataGridViewkala.CurrentRow.Cells[3].Value.ToString();}
what is wrong in my codes, i try these codes too,
txtkalapoint.Text=dataGridViewkala.SelectedRows[0].Cells[3].Value.ToString();
when i press the arrow key in text boxes,it shows the previous records.
Key down happens before the actions taken, not after.. You could look at either the datagrid for when it changes rows, or, do it on the keypress. or Key up