DialogResult yourAnswer = MessageBox.Show("Are you sure you want to delete the selected items?", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (yourAnswer == DialogResult.Yes) { for (int i = supplyDataGridView.Rows.Count - 1; i >= 0; i--) { object temp = supplyDataGridView.Rows[i].Cells[0].Value; if (!Convert.IsDBNull(temp) && Convert.ToBoolean(temp)) { supplyDataGridView.Rows.RemoveAt(i); } } } else {
}