-1

我希望从组合框中删除选定的项目组合框中的选定项目显示在数据网格视图中,我不希望从同一个组合框中重新选择相同的项目。如何才能做到这一点 ?,请帮忙

combobox1InHouseStatus.Items.RemoveAt(combobox1InHouseStatus.SelectedIndex);

我试过这个,但它不工作!

4

1 回答 1

0

我需要做同样的事情,但在我的情况下,可以选择多个项目。这是我使用的代码:

int x = this.aComboBox.SelectedItems.Count;
while (x >= 1) {
    this.aComboBox.Items.Remove(this.aComboBox.SelectedItems(x - 1));
    x -= 1;
}
于 2014-12-29T17:29:06.620 回答