开发者

Winforms ComboBox Bug?

开发者 https://www.devze.com 2023-01-08 23:35 出处:网络
Winforms ComboBox Shows {value=value, key=key} even if I already set the DisplayMember and ValueMember. Is this a known bug?

Winforms ComboBox Shows {value=value, key=key} even if I already set the DisplayMember and ValueMember. Is this a known bug?

I have 2 Comboboxes, lbSelectedGroups and lbAvailableGroups, both of them are bound to List<Role> and List<UserRole>, respectively, through a BindingList.

Both of them will be populated in the constructor, but usually only lbAvailableGroups contains data. When I try to add an item(onclick) on lbSelectedG开发者_如何转开发roups, in which data comes from lbAvailableGroups, it shows {value=value, key=key}.


It looks to me like your list contains KeyValuePair collection (probably came from some dictionary) instead of UserRole objects.

0

精彩评论

暂无评论...
验证码 换一张
取 消