Binding Combobox Using Dictionary as the Datasource
问题 I'm using .NET 2.0 and I'm trying to bind a combobox's Datasource to a sorted dictionary. So the error I'm getting is "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"; 回答1: SortedDictionary<string, int> userCache = new