private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do You really want to delete this Administrator?", "DELETE", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { int refadmin = (int)gridAll.Rows[gridAll.CurrentRow.Index].Cells[0].Value; if (admin.Delete_Admin(refadmin)) { MessageBox.Show("Admin ID" + refadmin + " is successfully Deleted", "Admin Deleted"); } else { MessageBox.Show("Administrator " + refadmin + " is not deleted.", "Try Again"); } } gridAll.DataSource = admin.Search_All_Admins(); ButtonControl(true, true, false, false, true, false); }