【发布时间】:2015-08-13 12:24:30
【问题描述】:
我有一个 xml 文件 加载到我的 datagridview 中。我加载到 datagridview 中的文件如下所示:
<?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
在我的程序中,我有 checkedlistbox,其中包含组名“name1”、“name2”等。我在删除按钮中的代码删除了checkedlistbox 上的第一个组名+包含此名称组的所有行.我想修改我的按钮以删除选定的选中列表框项目(组名)和包含此组名的所有行。我希望我解释得更清楚。 这是我的删除按钮代码:
private void deleteButton_Click(object sender, EventArgs e)
{
if (checkedListBox1.SelectedIndex == 1)
{
// string groupName = group.Attribute("name").Value;
hostsDataSet.Tables["group"].Rows[0].Delete();
}
}
【问题讨论】:
标签: c# datagridview items checkedlistbox