public void LoadHomeworkGrid() //Creating a function to load homework grid. { try { ViewHomeworkDG.ItemsSource = studentBL.GetAssignedHomework(student.StudentID); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }