ComboBox items DataSource刷新问题
//第一次给comboBox.DataSource赋值 显示 的是正确
List<string> instrumentList = new List<string>() { "111111", "22222222", "333333" };
comboBox1.DataSource=instrumentList;
//第二次再给comboBox.DataSource赋值 结果 还是上次的内容(错误方法)
List<string> newList = new List<string>() { "444", "555", "666" };
comboBox1.DataSource=newList;
//正确刷新方法是 先把comboBox.DataSource=null;然后再赋值
//正确方法如下
List<string> newList = new List<string>() { "444", "555", "666" };
comboBox1.DataSource=null;
comboBox1.DataSource=newList;