title: Rows cannot be programmatically added to the datagridview's row collection when the control is data-bound
body: <p>First of all, I looked up this related question in <a href="https://stackoverflow.com/questions/6128555/set-datagridview-cell-value-and-add-a-new-row#_=_">here</a>  but the solution <code>dataGridView1.Rows.Add()</code> doesn't work in my case.</p>
  
  <p>In my Datagridview, I have 3 TextBoxes for data input and 2 ComboBoxes for the user to choose the values (which are bound into the database). One of my TextBoxes is set to read only so that the users can only populate it outside the datagrid (with a normal TexBox and a Button).</p>
  
  <p>When the users fill a DataGridView with data, there is always an empty row at the bottom; so I disable this and I used this code to prevent the users from adding a new row inside the datagrid... </p>
  
  <pre><code>dataGridView1.AllowUserToAddRows = false
  </code></pre>
  
  <p>I only want to add a new row when the users click the button I mentioned above (which throws an error).  </p>
  
  <p>The error message I got was:</p>
  
  <blockquote>
    <p>"Rows cannot be programmatically added to the datagridview's row collection when the control is data-bound"</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/ZUTZX.jpg" alt="sample image">
  the one with a red arrow is a ComboBox, and the one with green arrow is a read only TextBox</p>