private void acceptChanges_Click(object sender, RoutedEventArgs e) { foreach (ClassTerm term in ListOfTerms) { if (term.IsWorkingDay == false) { ClassSqlCalendar.DeleteTerm(term.TermId); } } RefreshList(); RefreshDataGrid(); CurrentMonthDataGrid.SelectedIndex = 0; }