【发布时间】:2014-03-20 10:19:13
【问题描述】:
为什么会这样:
public Form1()
{
InitializeComponent();
exCheckedListBox1.DataSource = Profiles;
this.exCheckedListBox1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this, "States", true));
}
CheckedBindingList Profiles = new CheckedBindingList();
public int States
{
get
{
return Profiles.States;
}
set
{
Profiles.States = value;
}
}
}
public class CheckedBindingList : List<string>
{
public int States { get; set; }
}
但是当绑定更改为
this.exCheckedListBox1.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.Profiles, "States", true));
抛出异常? 非常非常非常非常感谢。我尝试从继承表单 List 的自定义列表类中绑定文件。
异常 - 无法绑定到数据源上的属性或列状态。 参数名称:dataMember
【问题讨论】:
-
如果您向我们展示例外情况,我们会有所帮助。