private void btnSupprimerDebits_Click(object sender, EventArgs e) { List <Flux> liste = new List <Flux>(); liste = GestionFlux.GetFlux(2); var result1 = MessageBox.Show("Voulez-vous vraiment supprimer ce débit ?", "Message d'information", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result1 == DialogResult.Yes) { dtgDebits.SelectionMode = DataGridViewSelectionMode.FullRowSelect; int rowIndex = dtgDebits.CurrentCell.RowIndex; int columnIndex = dtgDebits.CurrentCell.ColumnIndex; // Il choisit la colonne infectée par le choix libelleColumnId = Int32.Parse(dtgDebits.Rows[rowIndex].Cells[columnIndex].Value.ToString()); // Supprime le crédit avec l'id concerné GestionFlux.DeleteFlux(libelleColumnId); var result2 = MessageBox.Show("Votre débit a bien été supprimé" + "\nVoulez vous supprimé un autre débit ?", "Message d'information", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result2 == DialogResult.No) { Form.ActiveForm.Close(); } } }