WPF中ComboBox控件的Item属性如何绑定一个枚举
WPF中ComboBox控件的Item属性怎么绑定一个枚举
WPF中ComboBox控件的Item属性怎么绑定一个枚举
最好有Demo,谢谢各位了
------解决方案--------------------
绑定不了枚举,因为枚举没有继承自IEnumerable接口。
你可以 通过 this.myCombobox.Items.Add(); 添加。
------解决方案--------------------
你把枚举转换成List<T>在去绑定
------解决方案--------------------
WPF中ComboBox控件的Item属性怎么绑定一个枚举
最好有Demo,谢谢各位了
------解决方案--------------------
绑定不了枚举,因为枚举没有继承自IEnumerable接口。
你可以 通过 this.myCombobox.Items.Add(); 添加。
------解决方案--------------------
你把枚举转换成List<T>在去绑定
------解决方案--------------------
Array myArray = Enum.GetValues(typeof(myEnum));
this.myCombobox.ItemsSource = myArray;