53,606 views
3 votes
3 votes
Write steps to Delete data from ‘Datagridview’

User Artur Bodera
by
2.9k points

1 Answer

24 votes
24 votes

Step-by-step explanation:

private void btnDelete_Click(object sender, EventArgs e)

{

if (this.dataGridView1.SelectedRows.Count > 0)

{

dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);

}

}

User M Karimi
by
3.0k points