Give me any one idea.
private void btnDelete_Click(object sender, EventArgs e) { int IdColumn = 0; // enter the correct value for Id Column or the column which you are using it for deleting.. foreach (DataGridViewRow row in this.dataGridView1.SelectedRows) { dataGridView1.Rows.RemoveAt(row.Index); int id = Convert.ToInt32(row.Cells[IdColumn].Value); // write your sql command to delete this id // } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)