title: Delete rows from grid view programmatic
body: <p>I have gridview, it's datasource is <code>list&lt;string&gt;</code> and I added one checkbox column to select rows that I want to delete then I press delete.</p>
  
  <pre><code>attachdatagrid.DataSource = ConceptProperties.conceptsattachmentsfilename[mouseOverIndex].Select(x =&gt; new { FileName = x }).ToList();
  </code></pre>
  
  <p>the problem is my</p>
  
  <blockquote>
    <p>gridview EditMode</p>
  </blockquote>
  
  <p>properties is  EditOnKeystroke, and when I wrote </p>
  
  <pre><code>if ((bool)dr.Cells[0].Value != false)
                          {
                              found = true;
                              ConceptProperties.conceptsattachments[mouseeditIndex].RemoveAt(dr.Index);
                              ConceptProperties.conceptsattachmentsfilename[mouseeditIndex].RemoveAt(dr.Index);
                              attachdatagrid.Rows.RemoveAt(dr.Index);
                          }
  </code></pre>
  
  <p>I got exception :</p>
  
  <blockquote>
    <p>Rows cannot be programmatically removed unless the DataGridView is
    data-bound to an IBindingList that supports change notification and
    allows deletion.</p>
  </blockquote>
  
  <p>how can I delete the row?</p>