为什么CheckedListBox的数据绑定“隐藏”? [英] Why is Databinding for a CheckedListBox "Hidden"?
问题描述
CheckedListBox上的DataSource属性从Intellisense中隐藏。为什么?您可以使用绑定属性来使其正常工作,但我担心这是隐藏的原因,我不应该在CheckedListBox上数据绑定,因为我不知道的一些重要原因。
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.
在CheckedListBox上的数据绑定ok?
Is databinding on a CheckedListBox ok??
推荐答案
CheckedListBox
旨在与其 添加
和 AddRange
方法:
The CheckedListBox
is intended to be used with its Add
and AddRange
methods:
要在运行
的时候将对象添加到列表中,请使用AddRange
分配一个对象
引用的数组方法。
列表然后显示每个对象的默认
字符串值。您可以
将单个项目添加到
code>添加方法。
虽然数据绑定到 CheckedListBox
可能会工作,但您应该避免创建依赖于除类型的公共接口之外的任何内容。我建议您使用正确的方法,因为Microsoft将更改 CheckedListBox
。
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
.
这篇关于为什么CheckedListBox的数据绑定“隐藏”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!