kill_seth

DataGridView Find

Oct 8th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. private void FindRow(string Name)
  2. {
  3.     foreach (DataGridViewRow Item in DataGridView1.Rows())
  4.     {
  5.         if (Item.Cells(0).Value == Name)
  6.         {
  7.         DataGridView1.ClearSelection();
  8.         Item.Selected = true;
  9.         DataGridView1.FirstDisplayedScrollingRowIndex = Item.Index;
  10.     }
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment