[英]Devforce 7.2.2 and databinding and Winforms
我的应用程序在Visual Studio 2013,.NET 4.5.1,DevForce IdeaBlade 7.2.2和IdeaBlade数据绑定4.1.3中。
在窗体上,我放下一个Windows窗体组合框。 我将Windows绑定源放在窗体上,并将DataSource
属性设置为DomainModel.Offce
。
然后,我在窗体上放置一个IdeaBlade控件绑定管理器。 在CBM中,我将Office对象拖到现有的绑定选项卡上。 我将控件设置为OfficeComboBox
。 我点击ListConverters
属性按钮,设置ListSource
到OfficeBS绑定源和显示器件OfficeName
。 值成员是_Self。
这是Designer文件中的适当信息
listConverter2.DisplayMember = "OfficeName";
listConverter2.ListSource = this.OfficeBS;
//
// OfficeBS
//
this.OfficeBS.DataSource = typeof(DomainModel.Office);
this.MemberBM.Descriptors.Add(new IdeaBlade.UI.WinForms.ControlBindingDescriptor(this.OfficeComboBox, typeof(DomainModel.Member), "Office1", listConverter2));
在Form.cs文件中,在我的Load方法中,我有以下代码
OfficeBS.DataSource = Repository.GetOffices();
GetOffices() returns an IEnumerable<Office>
之后,我设置表单绑定源
MemberBS.DataSource = currentMember;
currentMember
是当前正在编辑的成员。
程序运行时。 显示表格,显示当前成员信息。 Office ComboBox列出了所有办公室。
这是问题所在。 Office ComboBox的文本框部分为空白。 它应显示成员当前的职位,但为空。
我在这里缺少简单的东西吗?
可以在DevForce论坛上查看对此问题的响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.