title: Datagridview, binding source, and invalid operation error
body: <pre><code> foreach (Listing s in fx)
              {
                  ListingBindingSource.Add(s);
              }
  </code></pre>
  
  <p>This in my code causes the following error:</p>
  
  <p>Invalid operation error: Operation is not valid due to the current state of the object.</p>
  
  <p>Now i checked, I am running this on the main thread. </p>
  
  <p>Also, it was working before. What changed recently is i changed Listing members, two of them, from int to string. I thought if i delete Listbindingsource and remake it, it would automatically change that. But it seems i have to do something else. Can anyone shed some light here.
  ListBindsource is the datasource to a datagridview.
  thanks</p>
  
  <p><em><strong></em>***</strong><em>SOLUTION</em><strong><em>*</em>**<em>*</em>**</strong></p>
  
  <pre><code> public Form1()
          {
              InitializeComponent();  Listing s1 = new  Listing();
               ListingBindingSource.Add(s1);
  }
  </code></pre>
  
  <p>for some reason this added it. When the form was created for some reason null was being passed into the bindingsource. why, i don't know.</p>
  
  <p>Some additional info:</p>
  
  <p>If i remove the bindingsource as a datasource of the gridview, the error vanishes</p>