if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dgvTest.Rows[e.RowIndex];
if (dgvTest != null)
lblID.Text = row.Cells["id"].Value.ToString();
txtName.Text = row.Cells["name"].Value.ToString();
txtSalary.Text = row.Cells["salary"].Value.ToString();
But the problem is how can I display the before one record selected. Mean to show the ID number 2 clicking on ID number 3.
I can click on ID number 5 but I want to be displayed on my textboxes the ID number 4.