Below code block somehow acts up as removing more than one of DataGridView. It removes two rows of DataGridView usually if not there is one only row main in DGV. What's the matter?
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
Int32 selectedRow = dataGridView1.SelectedRows[0].Index;
dataGridView1.Rows.RemoveAt(selectedRow);
}
}