在WinForms .Net 3.5中的CheckedListBox中没有DisplayMember

Ivr*_*vri 2 checkedlistbox winforms

我应该用什么呢?我已经尝试过DataBindings.Add,但我的数据没有加载我有3个属性的数据结构:ID,Name和eg Description.我想将整个数据加载到列表中,但只显示Name属性.通常我会将DisplayMember用于此目的,但我在这里找不到它.

cca*_*oni 5

DisplayMember和ValueMember标记为不可浏览,因此使用Intellisense不可见.这是CheckedListBox类的元数据:

// Summary:
//     Gets or sets a string that specifies a property of the objects contained
//     in the list box whose contents you want to display.
//
// Returns:
//     A string that specifies the name of a property of the objects contained in
//     the list box. The default is an empty string ("").
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
public string DisplayMember { get; set; }
Run Code Online (Sandbox Code Playgroud)

无论如何,它们实际上可以被使用,只需将它们用作具有正确外壳的属性,您不应该收到任何设计时错误.