for(int rowIndex = 0; rowIndex<dataGridView1.Rows.Count; rowIndex++) for (int columnIndex = 0; columnIndex < dataGridView1.ColumnCount; columnIndex++) { if (dataGridView1[columnIndex, rowIndex].Value.ToString() == textBox2.Text) return rowIndex; }
string strCode = "Hello"; int iRowindex = -1; for (int i = 0; i < Dgv.Rows.Count; i++) { if (strCode == Convert.ToString(Dgv.Rows[i].Cells[1].Value)) { Dgv.CurrentCell = Dgv.Rows[i].Cells[1]; Dgv.Rows[i].Selected = true; iRowindex = Dgv.Rows[i].Index; //although i and irowindex will be same } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)