private void btn_clear_Click(object sender, EventArgs e) { //confirm that they would like to clear all students if (MessageBox.Show("Are you sure you want to clear all student names?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //update the datagridview so all student names are removed dgv_class = RobotController.ClearAllStudents(dgv_class); } }