private void btnUnSet_Click(object sender, EventArgs e) { if (txtID.Text != "") { DialogResult dr = MessageBox.Show("Are You Sure to Delete This Set?", "QUESTION", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { SC.DeleteScore(int.Parse(txtID.Text)); if (getColumn(dgSet, 6) == "Not Yet") { MessageBox.Show("This Set Has Been UnSet!", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("This Set Can't UnSet!", "INFORMATION", MessageBoxButtons.OK, MessageBoxIcon.Information); } } RefreshGridView(); txtID.Clear(); btnUnSet.Enabled = false; } else { MessageBox.Show("Please, Choose the Students to UnSet...!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); dgSet.Focus(); } }