private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show("Do you realy want to delete?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) { return; } else { foreach (Student s in StudentsDataGrid.SelectedItems) { EntityDb.DeleteStudent(s); } GetStudents(); } }