Find the current row after a sort: snippet

from the Artful MySQL Tips List


After a sort, the current row may vanish. How to find it?
  BindingManagerBase bm = null;
  bm = DataGridView1.BindingContext[DataGridView1.DataSource, DataGridView1.DataMember];
  DataRow findRow = ((DataRowView)bm.Current).Row;
  int index = DataSet.Tables["mytable"].Rows.IndexOf(findRow);




Return to the Artful MySQL Tips page