Why is Databinding for a CheckedListBox “Hidden”?

隐身守侯 提交于 2019-12-10 17:09:52

问题


The DataSource property on a CheckedListBox is hidden from Intellisense. Why? You can use the binding properties to make it work, but I'm worried that it's hidden for a reason and that I shouldn't be databinding on a CheckedListBox for some important reason that I'm not aware of.

Is databinding on a CheckedListBox ok??


回答1:


The CheckedListBox is intended to be used with its Add and AddRange methods:

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.

While data binding to the CheckedListBox may work you ought to avoid creating dependencies on anything but the public interface of a type. I would recommend that you use the proper methods as this will make you code less brittle in the event that Microsoft changes the implementation of CheckedListBox.



来源:https://stackoverflow.com/questions/1346686/why-is-databinding-for-a-checkedlistbox-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!