private void Load(object sender, RoutedEventArgs e) { string combo_box_query = "SELECT * from Courses"; LoadGrid loadComboBox = new LoadGrid(combo_box_query); cb_course.ItemsSource = loadComboBox.FillGrid().DefaultView; }
private void Load(object sender, RoutedEventArgs e) { string grid_query = "SELECT student_course_fk_course_id , student_course_grade FROM Student_Course WHERE student_course_fk_student_uid =" + StudentLogin.student_uid; LoadGrid loadGrid = new LoadGrid(grid_query); dtgrd_student_course.DataContext = loadGrid.FillGrid(); try { dtgrd_student_course.Columns[0].Header = "Course Code"; dtgrd_student_course.Columns[1].Header = "Grade"; string combo_box_query = "SELECT * from Courses"; LoadGrid loadComboBox = new LoadGrid(combo_box_query); cb_test.ItemsSource = loadComboBox.FillGrid().DefaultView; } //https://blogs.msdn.microsoft.com/jaimer/2009/01/20/styling-microsofts-wpf-datagrid/ * catch (ArgumentOutOfRangeException example) { MessageBox.Show("Please complete a course before doing the test."); } }