title: Getting the correct Row Index after sorting data with the datagrid
body: <p>Whenever I sort the datagrid, the index of the row would still be the index from the datagrid when it wasn't sorted yet. How would I make it so that when I select a row, it would get the index from the newly sorted datagrid?</p>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>    Private Sub DataGridView_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView.CellClick
      selectedRow = DataGridView.CurrentCell.RowIndex
      TextBox1.Text = X_SystemDataSet.Table(selectedRow).Column1
      TextBox2.Text = X_SystemDataSet.Table(selectedRow).Column2
      TextBox3.Text = X_SystemDataSet.Table(selectedRow).Column3
  End Sub
  </code></pre>