title: Why Can I Not Suspend Binding on a BindingSource?
body: <p>First, the offending code:</p>
  
  <pre><code>public virtual void grid_RefreshFetchData(Object sender, RefreshEventArgs e)
  {
      C1DBGrid g = (C1DBGrid)sender;
      if (g.RefreshUseResult)
      {
          DataTable dtNew = FetchRawData(e.Argument);
          dt_Patch(dtNew, e.Argument);
          g.BindingSource.SuspendBinding();
          ((DataTable)g.BindingSource.DataSource).Clear();
          ((DataTable)g.BindingSource.DataSource).Merge(dtNew);
          g.BindingSource.ResumeBinding();
      }
  }
  </code></pre>
  
  <p>What you see is an event handler that is being called from a background thread that is ultimately launched because a Windows form wants data.  The grid object (it's a ComponentOne TrueDBGrid) is owned by that form, and we have events set up to allow the form to tell the grid to ask for new data.  That call leads to this handler, whose purpose is to request an underlying data class to fetch a DataTable with records, and then to merge that table with the grid's BindingSource (which is a DataTable of the same schema).</p>
  
  <p>My problem:  when the Merge() method is called to merge new data into the grid's (newly emptied) BindingSource (again, a DataTable itself), a massive series of exceptions is being thrown.  Each exception instance is really a triad of exceptions:  one System.Reflection.TargetInvocationException followed by a pair of System.InvalidOperationExceptions.  This results in incredibly poor performance, and this is what I must remedy.</p>
  
  <p>I understand what is happening.  On the form, we are binding TextBox controls to the grid's BindingSource using the control's Text property.  This binding is being fired every time a row is merged into the BindingSource.  That last part has not been observed, it's a bit of a guess, but the sheer quantity of exceptions suggests it is the correct assumption.  That, and the fact that when I commented out all of the binding, the performance increased dramatically.</p>
  
  <p>So what I am asking for is help understanding how I can suspend this binding trigger.  As you can see, I have lines in the event handler that attempt to suspend it on the BindingSource.</p>
  
  <p>I have already tried this as well:</p>
  
  <pre><code>g.SuspendBinding();
  </code></pre>
  
  <p>It made no difference.  In fact, I have tried suspending the binding on both ends of the equation, in the form and in the threaded refresh, but always all attempts have been fruitless.</p>
  
  <p>Can you help?</p>