编程语言
首页 > 编程语言> > c# – 为什么CheckedListBox的数据绑定“隐藏”?

c# – 为什么CheckedListBox的数据绑定“隐藏”?

作者:互联网

CheckedListBox上的DataSource属性对Intellisense是隐藏的.为什么?您可以使用绑定属性使其工作,但我担心它是隐藏的原因,我不应该在CheckedListBox上数据绑定由于一些我不知道的重要原因.

在CheckedListBox上数据绑定好吗?

解决方法:

CheckedListBox旨在与其AddAddRange方法一起使用:

To add objects to the list at run
time, assign an array of object
references with the AddRange method.
The list then displays the default
string value for each object. You can
add individual items to the list with
the Add method.

虽然绑定到CheckedListBox的数据可能有效,但您应该避免在除类型的公共接口之外的任何内容上创建依赖关系.我建议您使用正确的方法,因为这将使您在Microsoft更改CheckedListBox的实现时不那么脆弱.

标签:c,data-binding,checkedlistbox
来源: https://codeday.me/bug/20190622/1259975.html