title: datatable bound to datagridview through bindingsource
body: <p>I have a datagridview on a windows form. I have a bindingsource and datatable which are created at runtime which I intend to use to bind and keep my datagridview updated.</p>
  
  <p>When debugging I see that my datatable is being populated with rows. I can also see my bindingsource's datasource has data when you open the visualizer.</p>
  
  <p>My issue is that my datagridview stays blank and never seems to get any of the data that my datatable and bindingsource are getting.</p>
  
  <p>Code Sample:</p>
  
  <pre><code> Private bs1 As New BindingSource
   Private TraysToScanDatatable As New DataTable
  </code></pre>
  
  <p>in my constructor</p>
  
  <pre><code>TraysToScanDatatable.Columns.Add(New DataColumn("time", GetType(DateTime)))
  TraysToScanDatatable.Columns.Add(New DataColumn("scanner", GetType(Integer)))
  TraysToScanDatatable.Columns.Add(New DataColumn("traynumber", GetType(Integer)))
  bs1.DataSource = TraysToScanDatatable
  UpdateDataGridView(TraysToReadDataGridView, bs1.DataSource) 'if I do not set my datagridview with a delegate here then I cannot update the binding source in the timer.
  </code></pre>
  
  <p>update timer logic</p>
  
  <pre><code>  TraysToScanDatatable.Rows.Add(New Object() {DateTime.Now, 1, lastScanner1TrayReceived})
    Me.bs1.DataSource = TraysToScanDatatable
    me.bs1.MoveLast
  </code></pre>
  
  <p>and my updatedatagridview routine</p>
  
  <pre><code> Public Sub UpdateDataGridView(ByVal control As DataGridView, ByVal newdata As DataTable)
      If Not control.InvokeRequired Then
          control.DataSource = newdata
      Else
          Invoke(New Action(Of DataGridView, DataTable)(AddressOf UpdateDataGridView), control, newdata)
      End If
  End Sub
  </code></pre>