当我尝试将自己创建的控件添加到窗体时,Visual Studio 会抛出错误: 无法绑定到数据源上的属性或列项名称。参数名称:dataMember 谁能告诉我,可能我做错了,因为我认为放置整个类是不必要的。
public partial class ctrlDetailGradation : BaseDetailsControl
{
protected override DevExpress.XtraDataLayout.DataLayoutControl LayoutMain { get { return dataLayoutControl; } }
public SALES_Gradation CurrentGradation
{
get { return GetXPOObject as SALES_Gradation; }
}
public bool bEditMode { get; set; }
public ctrlDetailGradation():base(null)
{
OnConstructInit();
}
public ctrlDetailGradation(IMxPEditObjectHandlerInterface cEditObjInterface)
: base(cEditObjInterface)
{
OnConstructInit();
}
private void OnConstructInit()
{
InitializeComponent();
InitLngStrings();
}
...
有部分代码,就是简单的类... BaseDetailsControl 继承自 usercontrol