33.1k views
5 votes
Write steps to Delete data from ‘Datagridview’

User Mennanov
by
3.3k points

1 Answer

4 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 Dangowans
by
3.0k points