My DataGridView is a single line selection and theres a rowEnter Event where I get the line index every time the selected line changes.
private void rowEnter(object sender, DataGridViewCellEventArgs e)
{
currentRowIndex = e.RowIndex;
}
when I press a delete button I use the same index to delete the row
myDataSet.Avaliado.Rows[currentRowIndex].Delete();
avaliadoTableAdapter.Update(myDataSet.Avaliado);
it works fine if no column in the DataGridView is sorted, otherwise a get an error. What should be the way to know the row index in the dataset that corresponds to the rowindex from the DataGridView?