title: DataGridView not updating in UI when underlying datasource changes
body: <p>I am creating a small Windows Form application that will receive messages from a background thread and then add them to a List on the Main form. On the form I have a <strong>DataGridView</strong> with the <strong>DataSource</strong> set to the message list (<em>e.g. <code>List&lt;Message&gt;</code></em>)</p>
  
  <p>At the moment, messages are piling up but I can't get the <strong>DataGridView</strong> to render the messages as they arise. Here is a summary of the approach I have used.</p>
  
  <p><strong>1.</strong> Initialize the main form setting the binding and startnig the message routines</p>
  
  <pre><code>internal Main(IMessageDispatcher messageDispatcher, IMessagePublisher messagePublisher)
  {
      InitializeComponent();
  
      _messageEntries = new List&lt;Message&gt;();
  
      BindToMessageEntriesList();
  
      _messageDispatcher = messageDispatcher;
      _messageDispatcher.OnMessageReceived += MessageDispatcher_OnMessageReceived;
      _messageDispatcher.Start();
  }
  
  private void BindToMessageEntriesList()
  {
      MessageEntriesGrid.DataSource = _messageEntries;
  }
  </code></pre>
  
  <p><strong>2.</strong> Process received messages and add to the internal list</p>
  
  <pre><code>private void MessageDispatcher_OnMessageReceived(Message message)
  {
      lock (_logEntries)
      {
          _messageEntries.Add(message);
      }
  
      var cb = new RefreshListCallbackDelegate(RefreshView);
      this.Invoke(cb);
  }
  </code></pre>
  
  <p><strong>3.</strong> Refresh on the main thread</p>
  
  <pre><code>private void RefreshView()
  {
      MessageEntriesGrid.Refresh();
  }
  </code></pre>
  
  <p>Can anyone suggest how I can get the UI to reflect the changes as they occure. </p>
  
  <p><em>Note: I have also tried using the Invalidate method and the ResetBindings method. I also tried switching the List to an <code>ObservableCollection</code></em></p>