private void ComboBoxNameOnSelectionChanged(object sender, SelectionChangedEventArgs e) { _currentIndex = DgEtudiant.SelectedIndex; (DgEtudiant.DataContext as DataSet)?.Clear(); var name = (sender as ComboBox)?.SelectedItem as string; _sqliteDataBase.SortOnName(name); _sqliteDataBase.Fill(_sqliteDataBase.DataSet); UpdateEnregistrement(); // Err(11) DgEtudiant.SelectedIndex = _currentIndex; }