title: DataGridView and DataTable: program freeze
body: <p>There is a very strange situation: my application has different behavior while running in VS dubugger and directly as EXE.</p>
  
  <p>After gathering some data, I put the resulting <code>DataTable</code> into <code>DataGridView</code> with this code:</p>
  
  <pre><code>dataGridView.DataSource = null;
  dataGridView.DataSource = x.Table; //x.Table is DataTable
  </code></pre>
  
  <p>There is another question: why doesn't <code>DataGridView</code> refresh without setting it's <code>DataSource</code> to <code>null</code>, and I'd be very glad to know the answer, but it's not so important right here.</p>
  
  <p>So, the most important: when I run my application in VS debugger, this code block works properly, but when I run the EXE, execution breaks on the second of lines (I see it in the log written), program freezes and doesn't respond.</p>
  
  <p>I've also found out, that replacing the second code line by</p>
  
  <pre><code>dataGridView.DataSource = x.Table.Copy();
  </code></pre>
  
  <p>makes it work in both cases.
  Does anybody have an idea on the situation reasons?</p>