private void RemoveSpecialty_Click(object sender, RoutedEventArgs e) { int SelectedSpecialtyId; SelectedSpecialtyId = SpecialtiesGrid.SelectedIndex; Specialty SelectedSpecialty; SelectedSpecialty = (Specialty)SpecialtiesGrid.Items[SelectedSpecialtyId]; dbl.RemoveSpecialty(SelectedSpecialty); Specialties.Remove(SelectedSpecialty); }