How to delete object from combobox?

前端 未结 6 1962
遇见更好的自我
遇见更好的自我 2021-01-25 18:37

I have a combobox with objects of Foo type, here is the Foo class:

public class Foo
{
    public string name { get; set; }
    public s         


        
6条回答
  •  春和景丽
    2021-01-25 19:01

    comboBox2.Items.Remove(comboBox2.SelectedValue); will only remove from the combobox, not from the datasource bound to the combobox. You may remove it from the datasource and re-bind the datasource.

提交回复
热议问题