title: How to add New Row in datagridview which is bound to the datasource
body: <p>I have a datagridview that is bound to a datasource. I have to add a new row in datagridview when I click Edit button or New button.I tried some code but its giving me error, code is given below</p>
  
  <pre><code>DataGridView grdview = new DataGridView();
  grdview.Rows.Add();
  grdview.Rows[grdview.Rows.Count - 1].Cells[0].Selected = true;
  grdview.BeginEdit(false);
  </code></pre>
  
  <p>I also tried typecasting of datasource to datatable but no solution.</p>