The SelectedRowIndex property of the DataGrid indicates the index of the current row in the table's DefaultView, which doesn't necessarily correspond to the index of the same row in the DataTable itself. You could call the Delete method of the DataRowView or the actual DataRow it corresponds to:or:Code:myTable.DefaultView[myGrid.CurrentRowIndex].Delete();I believe that you can also use the Postition property of a BindingManagerBase object associated with the DataGrid, but I've never done that myself so I can't offer any specific advice except to perhaps start with the DataGrid.BindingContext property if you're interested.Code:myTable.DefaultView[myGrid.CurrentRowIndex].Row.Delete();




Reply With Quote