title: Remove data from database but not from datagrid. WPF
body: <p>I have problem with refreshing my datagrid. 
  Have simple application to create new clients connected with Entity Framework. 
  Have 3 buttons to create new one, save changes and delete. First two are working well, but have little problem with delete selected row.
  After click delete button, object is removed from database but datagrid is not update.
  I tried to use .Items.Resfresh(), load ItemSource from the beggining, remove selected row but there are catched some exceptions </p>
  
  <p>f.e. (Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.)</p>
  
  <p>Should I implement ObservableCollection (i'm quite new to wpf, if yes then how)?</p>
  
  <p><strong>C#</strong></p>
  
  <pre><code>private void UserControl_Loaded(object sender, RoutedEventArgs e)
  {
      _isLoading = true;
      clientDataGrid.ItemsSource = _repo.ClientsListInMemory();
      _clientViewSource = (ObjectDataProvider)FindResource("clientViewSource");
      _isLoading = false;
      clientDataGrid.SelectedIndex = 0;
  }
  
  private void deleteBtn_Click(object sender, RoutedEventArgs e)
  {
      HotelContext db = new HotelContext();
      Client client = clientDataGrid.SelectedItem as Client;
      try
      {
          _currentClient = db.Clients.Where(c =&gt; c.Id == client.Id).Single();
          db.Clients.Remove(_currentClient);
          db.SaveChanges();
      //  refreshFunction()?
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
  }
  </code></pre>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ObjectDataProvider x:Key="clientViewSource"/&gt;
  &lt;/UserControl.Resources&gt;
  &lt;DataGrid x:Name="clientDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" IsReadOnly="True" ItemsSource="{Binding Source={StaticResource clientViewSource}}" Margin="0,10,323,0" RowDetailsVisibilityMode="VisibleWhenSelected" SelectionChanged="clientDataGrid_SelectionChanged" SelectedValuePath="Id" Height="200" VerticalAlignment="Top"&gt;
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn x:Name="Id" Binding="{Binding Id}" Header="Id" Width="SizeToHeader"/&gt;
          &lt;DataGridTextColumn x:Name="firstNameColumn" Binding="{Binding FirstName}" Header="First Name" Width="SizeToHeader"/&gt;
          &lt;DataGridTextColumn x:Name="lastNameColumn" Binding="{Binding LastName}" Header="Last Name" Width="SizeToHeader"/&gt;
          &lt;DataGridTextColumn x:Name="phoneNumberColumn" Binding="{Binding PhoneNumber}" Header="Phone Number" Width="SizeToHeader"/&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>