I have a GridView and its DataSource is datatable.OnRowDeleting
event of Gridview. I can't seem to delete that row when I click the 'delete' button that invokes the event to remove the row.
My code is like this in RowDeleting
event of GridView:
DataTable.Rows.Remove(GridView.DataKeys(e.rowindex).value)
I get the error:
"Cannot type cast from System.Int32 To System.Data.DataRow"
Does anyone have any suggestions?