title: How to delete all checked name rows in DataTable?
body: <p>I have an <strong>xml file</strong> loaded into my datagridview. The file that I load into datagridview looks like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot;?&gt;
  &lt;program&gt;
    &lt;group active=&quot;1&quot; name=&quot;name3&quot;&gt;
      &lt;item active=&quot;Active&quot;&gt;
        &lt;id&gt;name3&lt;/id&gt;
        &lt;ip&gt;223.26.0.0&lt;/ip&gt;
        &lt;names&gt;jakas strona&lt;/names&gt;
        &lt;comment&gt;komentarz&lt;/comment&gt;
      &lt;/item&gt;
      &lt;item active=&quot;Active&quot;&gt;
        &lt;id&gt;name3&lt;/id&gt;
        &lt;ip&gt;223.26.0.0&lt;/ip&gt;
        &lt;names&gt;jakas strona&lt;/names&gt;
        &lt;comment&gt;komentarz&lt;/comment&gt;
      &lt;/item&gt;
    &lt;/group&gt;
  &lt;/program
  </code></pre>
  <p>In my program I have <strong>checkedlistbox</strong> which contains group names &quot;name1&quot;, &quot;name2&quot;, etc. My code in delete button delete first group name on the checkedlistbox + all rows which contains this name group. I want to modify my button to delete selected checkedlistbox item(name of group) and all rows which contain this group name. I hope I explained in more clearly.
  This is my delete button code:</p>
  <pre><code>private void deleteButton_Click(object sender, EventArgs e)
  {
      if (checkedListBox1.SelectedIndex == 1)
      {
          // string groupName = group.Attribute(&quot;name&quot;).Value;
          hostsDataSet.Tables[&quot;group&quot;].Rows[0].Delete();
      }              
  }
  </code></pre>