title: CRUD on BindingSource in Winforms
body: <p>I have a <code>DataGridView</code> and a <code>BindingSource bs</code> populated using <code>bs.DataSource = list;</code> where <code>list</code> is a <code>BindingList&lt;Item&gt;</code>.</p>
  
  <p>All I want is to have each changed <code>Item</code> notified that it is changed, and each deleted item notified that it is deleted. Or instead, I would like to have access to changed, new and deleted items after user edits the grid and presses the button.</p>
  
  <p><strong>Edit</strong>:</p>
  
  <pre><code>public abstract class Item : INotifyPropertyChanged { .......
  public Item()
  {
      Id = IdCounter++;
      Pairs = new HashSet&lt;int&gt;();
      State = ItemState.NEW;
      Name = "#noname";
      Note = "";
      PropertyChanged += new PropertyChangedEventHandler(Item_PropertyChanged);
  }
  
  void Item_PropertyChanged(object sender, PropertyChangedEventArgs e)
  {
      SetChanged();
  }
  
  /* nastaví příznak, že se něco změnilo - to následně vyvolá UPDATE (při použití SQL úložiště) */
  public void SetChanged()
  {
      State = ItemState.CHANGED;
  }
  </code></pre>