public ViewStudents() { InitializeComponent(); //Get course schedule list lcSchedules = ScheduleManager.GetSchedulesOf(GlobalApplication.cMyUser, RoleTypes.Tutor); //If there are schedules if (lcSchedules.Count > 0) { //Set each schedules to combo box for (int i = 0; i < lcSchedules.Count; i++) { cbCourses.Items.Add(lcSchedules[i].GetCourse().Course_Name); } //Set first selection cbCourses.SelectedValue = cbCourses.Items[0]; cbCourses.Refresh(); } }
public CourseView() { InitializeComponent(); //Get list of course schedules and courses this user is enrolled on. lcSchedules = ScheduleManager.GetSchedulesOf(GlobalApplication.cMyUser, RoleTypes.Student); //If there are schedules if (lcSchedules.Count > 0) { lcCourses = lcSchedules.ToCourses(); //Populate the combo box for (int i = 0; i < lcCourses.Count; i++) { cbCourses.Items.Add(lcCourses[i].Course_Name); } //Set first selection cbCourses.SelectedIndex = 0; cbCourses.Refresh(); } }