title: How to update datasource of datagridview from another thread in c#
body: <p>I have a backgrounder thread running along with a ui thread. Now in the backgrounder_doWork method, i have a datatable that i am adding info to from a database. I want it to bind to a datagridview in the ui thread to display to the user. So when the dataTable is updated with new info as it comes in from the database, the datagridview should automatically refresh to add/subtract any new rows of info recieved from the backgrounding thread. How can i do this? I have tried this:</p>
  
  <pre><code>private delegate void dGValueDelegate();
  private void dGVValue()
  {
      BindingSource bSource = new BindingSource();
      dtFailures.DataSource = bSource;
      bSource.DataSource = dt;
  }
  </code></pre>
  
  <p>where dt is a class level variable. Inside the backgrounder_dowork method, at the beginning i call the dGVVAlue method and then after that the info gets added to the datatable in the backgrounding thread. The datagridview wont display however...</p>