I am using a DataGrid control with a DataTable as a data source.
Everything seem to work fine until the DataGrid is sorted by clicking on the
column header. After that I do not know how to associate the DataGrid
selected row with a DataTable row.
Here is the code that I use to delete a row how can I
private void DeleteLine_Click(object sender, System.EventArgs e)
{ int Idx = ICD_Grid.CurrentRowIndex;
int Idx2= m_CurrencyManager.Position;
if (Idx>=0)
{
m_DataTable.Rows.RemoveAt(Idx);
ICD_Grid.CurrentRowIndex=Idx;
}
}