private void RemoveFaculty_Click(object sender, RoutedEventArgs e) { int SelectedFacultyId; SelectedFacultyId = FacultiesGrid.SelectedIndex; Faculty SelectedFaculty; SelectedFaculty = (Faculty)FacultiesGrid.Items[SelectedFacultyId]; dbl.RemoveFaculty(SelectedFaculty); Faculties.Remove(SelectedFaculty); }