// Handle Delete Button Click private void Btn_DelStudent_Click(object sender, EventArgs e) { students.Remove(selectedStudent); StudentsDB.SaveStudents(students); List_Students.ClearSelected(); }
// Adds new student to the list public void InsertUpdateStudentList(Student newStudent) { students.Add(newStudent); StudentsDB.SaveStudents(students); UpdateDataSource(); List_Students.SetSelected(0, true); }
// Assigns and Updates DateBindings public void UpdateDataSource() { // Reads students list from file students = StudentsDB.GetStudents(); List_Students.DataSource = null; List_Students.DataSource = students; List_Students.DisplayMember = "DisplayName"; }
// Updates student scores public void UpdateStudentScoresList(Student studentToUpdate, BindingList <int> newScores) { studentToUpdate.Scores = newScores; StudentsDB.SaveStudents(students); UpdateDataSource(); List_Students.ClearSelected(); }