private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= -1) { DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; textBox2.Text = row.Cells[0].Value.ToString(); textBox3.Text = row.Cells[1].Value.ToString(); textBox4.Text = row.Cells[2].Value.ToString(); textBox5.Text = row.Cells[3].Value.ToString(); } }
if (e.RowIndex >= -1)
if ((e.RowIndex > -1) && (e.RowIndex < dataGridView1.Rows.Count))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)