title: "Deleted row information cannot be accessed through the row" trying to remove unused rows from my datatable
body: <p>I'm grabbing data, sticking it into a <code>DataTable</code>, and displaying it in a <code>DataGridView</code> bound to that table. Im trying to make it so that data in the datatable that is not included in the current grab is deleted. I'm doing it as follows:</p>
  
  <pre><code>public void FillTable(DataTable table, IEnumerable&lt;MyObject&gt; readings)
  {
      var currentReadingsNames = new List&lt;string&gt;();
      var lastParent = string.Empty;
      var index = 0;
  
      foreach (var reading in readings)
      {
          if (reading.ParentName != lastParent)
          {
              lastParent = reading.ParentName;
              index = 0;
          }
          LoadRow(table, reading, index++);
          currentReadingsNames.Add(MakeKey(reading));
      }
  
      //Iterate through the rows in our data table. If the row is not one we just loaded, get rid of it.
      foreach (DataRow row in table.Rows)
      {
          if (!currentReadingsNames.Contains(MakeKey(row["ParentID"].ToString(), row["ID"].ToString())))
          {
              row.Delete();
          }
      }
      table.EndLoadData();
  }
  </code></pre>
  
  <p><code>MakeKey(reading)</code> and <code>MakeKey(properties)</code> returns a string I can use to identify my object two different ways. Assume that this works.</p>
  
  <p>When I run this, I get:</p>
  
  <blockquote>
    <p>Deleted row information cannot be accessed through the row.</p>
  </blockquote>
  
  <p>I feel like I shouldn't be attempted to access a deleted row, because I only delete the row after I'm done looking at its values (the <code>parentID</code> and <code>ID</code> column). Does this behave differently than I am understanding? Any ideas why this is happening? If this code should work, maybe the error is somewhere else, but I haven't changed anything else so I would be surprised (I'm trying to add this deleting behavior).</p>