When search row selected then selected row show on top of gridviewrow automatically with highlighted and previous data also show but selected row index change.
问题是当我可以搜索 500 行时,我在 gridview 中有 1000 行数据,因此 500 行显示在 gridview 行的顶部,其他数据也显示在 gridview 中。
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (Convert.ToInt32(row.Cells[0].Value) == Convert.ToInt32(txt_empc.Text))
{
row.Selected = true;
//when search row selected then selected row show on top of gridviewrow
//automatically with highlighted and previous data also show but selected
//row index change
}
}