/// <summary> /// Helper function to add the problem sets to the student /// </summary> /// <param name="sender">The object that raised the event</param> /// <param name="e">The event arguments</param> /// <history> /// <Created 23 April 2014>Arun Gopinath && Jeff Bunce</Created> /// <Modified 23 April 2014></Modified> /// </history> private void CreateAssignment() { List <ProblemSet> problemSetList = new List <ProblemSet> (); List <Student> SelectedStudents = new List <Student> (); foreach (DataGridViewRow row in dtgStudentList.SelectedRows) { SelectedStudents.Add(( Student )row.DataBoundItem); } dtgProblemSetList.Refresh(); foreach (DataGridViewRow row in dtgProblemSetList.SelectedRows) { ProblemSet ps = (ProblemSet)row.DataBoundItem; problemSetList.Add(ps); } mmControl.AddNewAssignment(SelectedStudents, problemSetList); UpdateBindings(); }