I am using the DataGridView KeyDown event, and the handler determines whether the Delete key has been pressed:
if e.KeyCode == Keys.Delete...
Then find which element / row to remove by getting the SelectedRows property if your DataGridView is in FullRowSelect or RowHeaderSelect mode, otherwise you can define a row with something like this:
i = SelectedCells[0].RowIndex
then
DataGridView.Rows[i].DataBoundItem
You just need to remove the corresponding record from the database and possibly update the DataGridView based on its binding ...
source share