【发布时间】:2021-08-08 17:05:09
【问题描述】:
我正在使用 .NET 2.0,并且正在尝试将组合框的数据源绑定到已排序的字典。
所以我得到的错误是“DataMember property 'Key' cannot be found on the Datasource”。
SortedDictionary<string, int> userCache = UserCache.getSortedUserValueCache();
userListComboBox.DataSource = new BindingSource(userCache, "Key"); //This line is causing the error
userListComboBox.DisplayMember = "Key";
userListComboBox.ValueMember = "Value";
【问题讨论】:
标签: c# .net winforms combobox datasource