I have an xml file loaded into my datagridview. The file that I load into datagridview looks like this:
<?xml version="1.0" standalone="yes"?>
<program>
<group active="1" name="name3">
<item active="Active">
<id>name3</id>
<ip>223.26.0.0</ip>
<names>jakas strona</names>
<comment>komentarz</comment>
</item>
<item active="Active">
<id>name3</id>
<ip>223.26.0.0</ip>
<names>jakas strona</names>
<comment>komentarz</comment>
</item>
</group>
</program
In my program I have checkedlistbox which contains group names "name1", "name2", 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:
private void deleteButton_Click(object sender, EventArgs e)
{
if (checkedListBox1.SelectedIndex == 1)
{
// string groupName = group.Attribute("name").Value;
hostsDataSet.Tables["group"].Rows[0].Delete();
}
}