private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { //if (dataGridView1.CurrentRow.Index == 0) // { // MessageBox.Show("please dont select Header columns"); // } if (dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "Select") { //int index = dataGridView1.CurrentRow.Index; textBox1.Text = dataGridView1.Rows[e.RowIndex].Cells["School_id"].Value.ToString(); textBox1.ReadOnly = true; textBox2.Text = dataGridView1.Rows[e.RowIndex].Cells["School_name"].Value.ToString(); } else { MessageBox.Show("please enter select button only"); } } }
dataGridView1.ColumnHeadersVisible = false;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)