title: Silverlight 4 with RIA Services - Refresh Datagrid bound to CollectionView
body: <p>Here is my situation:</p>
  
  <p>I have a domain datasource in my Silverlight 4 page. I've pulled associated entities from RIA Services and displayed them on the same page using a collectionview.</p>
  
  <p>In a button click event I insert/add an entity (see code snippet below).</p>
  
  <p>How do I get the datagrid to refresh? What am I doing wrong?</p>
  
  <p>I know the data is being inserted into the database just can't get the grid to refresh without leaving the page and coming back.</p>
  
  <pre><code>DomainContext ctx = new DomainContext();
  foreach (&lt;Entity&gt; x in EntityList)
        {
          &lt;Entity&gt; y = new &lt;Entity&gt;
          {
            .... &lt;set values&gt;
          };             
  
          ctx.&lt;Entity&gt;.Add(y);
  
        }
  
        ctx.SubmitChanges();
        DomainDataSource.Load(); ;
        CollectionView.View.Refresh();               
  </code></pre>