解决方案 »

  1.   

    解析好json字符串并转为对象之后,就可以直接绑定到combobox了。
    解析json
    绑定代码(举个例子)
     this.comboBox1.DataSource = products;
                this.comboBox1.DisplayMember = "name";
                this.comboBox1.ValueMember = "num";
      

  2.   


    我写了一个类:ComboboxItem类,我是通过下面的方法绑定的:var items4 = new[]  { 
    new ComboboxItem("---请选择---", "-1"),
    new ComboboxItem("是", "0"),
    new ComboboxItem("否", "1")
    };
    this.isException.DataSource = items4;// isException是一个下拉框可以用该类做上面类似的操作吗?如果可以,我该如何从lcList中拿出想要的字段来new ComboboxItem,换句话说,该把lcList做什么样的封装来方便操作?我刚接触C#,链接的文章看不太懂,还是谢谢你!