简体   繁体   English

Devforce 7.2.2以及数据绑定和Winforms

[英]Devforce 7.2.2 and databinding and Winforms

My application is in Visual Studio 2013, .NET 4.5.1, DevForce IdeaBlade 7.2.2 and IdeaBlade databinding 4.1.3. 我的应用程序在Visual Studio 2013,.NET 4.5.1,DevForce IdeaBlade 7.2.2和IdeaBlade数据绑定4.1.3中。

On a form, I drop a windows form combo box. 在窗体上,我放下一个Windows窗体组合框。 I place a windows binding source on the form and set the DataSource property to DomainModel.Offce . 我将Windows绑定源放在窗体上,并将DataSource属性设置为DomainModel.Offce

I then place an IdeaBlade Control Binding manager on the form. 然后,我在窗体上放置一个IdeaBlade控件绑定管理器。 In the CBM I drag the Office object to the existing bindings tab. 在CBM中,我将Office对象拖到现有的绑定选项卡上。 I set the control to the OfficeComboBox . 我将控件设置为OfficeComboBox I click the ListConverters properties button and set the ListSource to the OfficeBS binding source and the display member to OfficeName . 我点击ListConverters属性按钮,设置ListSource到OfficeBS绑定源和显示器件OfficeName The value member is _Self. 值成员是_Self。

Here is the appropriate info from the Designer file 这是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));

In the Form.cs file In my Load method I have the following code 在Form.cs文件中,在我的Load方法中,我有以下代码

OfficeBS.DataSource = Repository.GetOffices();

GetOffices() returns an IEnumerable<Office>

After this I set the forms binding source 之后,我设置表单绑定源

MemberBS.DataSource = currentMember;

currentMember is the member that is currently being edited. currentMember是当前正在编辑的成员。

When the program is run. 程序运行时。 The form displays, the current members information is displayed. 显示表格,显示当前成员信息。 The Office ComboBox has all the offices listed. Office ComboBox列出了所有办公室。

Here is the problem. 这是问题所在。 The text box portion of the Office ComboBox is blank. Office ComboBox的文本框部分为空白。 It should show the members current office but it is empty. 它应显示成员当前的职位,但为空。

Am I missing something simple here? 我在这里缺少简单的东西吗?

可以在DevForce论坛上查看对此问题的响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM