title: DataBinding DataGridView to EF.DbSet, how to send new DataGridView rows to DbSet?
body: <p>I want to databind my DataGridView control to database through Entity model (created with model first approach), i am using EF 5.0, .NET 4.5 and winforms</p>
  
  <p><strong>My binding is organized as follows:</strong></p>
  
  <p>DataGridView->BindingSource->BindingList->EF.DbSet->Database</p>
  
  <p><strong>The result (problem) is</strong></p>
  
  <p>1) updates to existing records are working properly</p>
  
  <p>2) <strong>inserts</strong> are sent up to BindingList, but they <strong>ARE NOT</strong> sent to EF.DbSet</p>
  
  <p><em>What could be the cause for this and how can I solve this?</em></p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>    //form level objects
      private BindingList&lt;Person&gt; persons;
      private BindingSource pSource=new BindingSource();
  
      private void Form1_Load(object sender, EventArgs e)
      {
          _context=new TestEFmodelContainer();
          var p = _context.PersonSet.ToList();
          persons = new BindingList&lt;Person&gt;(p); //getting bindinglist
          persons.AllowEdit = true;
          persons.AllowNew = true;
  
          pSource.DataSource = persons;
          pSource.AllowNew = true;
  
          personDataGridView.DataSource = pSource;
      }
  
      //"Save changes to DB" button
      private void SaveChangesToDB_Click(object sender, EventArgs e)
      {
          _context.SaveChanges();
      }
  </code></pre>