遍历datagridview的单元格,判断单元格内的值是否与textbox的text相等。
foreach (DataGridViewRow row in dataGridView1.Rows)
{
foreach(DataGridViewCell cell in row)
{
if(cell.value = textbox1.text) then
cell.focus()
else
msg("没有找到相关信息")
}
}