title: Get the corresponding row in the datatable from the selection in datagridview
body: <p>I have a DataTable which is bound to datagridview (Winforms)... I use the following two lines to get the DataRow that is selected in the datagridview...</p>
  
  <pre><code>        int l_intSelectedRow = DataGridView1.SelectedRows[0].Index;
  
          DataRow l_drwSelectedRow = ControlGroupPostedItems.Tables["PostedItems"].Rows[l_intSelectedRow];
  </code></pre>
  
  <p>This works fine until the DataGridView is Sorted... When the gridview is sorted by the, I get the incorrect values (1st selection of the sorted view return 1st row of unsorted Table).</p>
  
  <p>How could I solve this...  Is looping through the datatable the only way...  </p>
  
  <p>Thank you.</p>