private void gvProblem_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) { DialogResult dialogResult = MessageBox.Show("Chắc chắn xóa ?", "Xac nhan", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { // MessageBox.Show(e.Row.Cells[0].Value.ToString()); f.Remove(Convert.ToInt32(e.Row.Cells[recordIdIndex].Value.ToString())); MessageBox.Show("Đã xóa"); LoadData(); } }
private void btnRemove_Click(object sender, EventArgs e) { MasterPass masterPass = new MasterPass(); masterPass.ShowDialog(); if (masterPass.Result()) { int temp = rowTemp; BLFailRecord re = new BLFailRecord(); re.setId(Convert.ToInt32(gvProblem.Rows[temp].Cells[recordIdIndex].Value.ToString())); re.Remove(Convert.ToInt32(gvProblem.Rows[temp].Cells[recordIdIndex].Value.ToString())); MessageBox.Show("Đã xóa"); LoadData(); } }