use the row or cell click event to help store seletedrows
and use selectedrows to be the index to delete the entire row of the data in datagridview like this
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView dgv = sender as DataGridView;
if (dgv == null)
return;
if (dgv.CurrentRow.Selected)
{
int selectedrows = 0;
selectedrows = dgv.CurrentRow.Index;
dgv.removeat(selectedrows);
}
}
it should work : )