C# bindingSource中的最后一项没有更新组合框

C# bindingSource中的最后一项没有更新组合框,c#,winforms,data-binding,combobox,C#,Winforms,Data Binding,Combobox,我将一个组合框绑定到数据源(clientInfoBindingSource)以获取其所选项目和文本,我在另一个数据源(totalsBindingSource)和上使用自动生成的绑定导航器 它应该更新客户端信息绑定源的当前对象 private void updateClientInfo(object sender, EventArgs e) { clientInfoBindingSource.Position = clientInfoBindingSource.Find("ClientID

我将一个组合框绑定到数据源(clientInfoBindingSource)以获取其所选项目和文本,我在另一个数据源(totalsBindingSource)和上使用自动生成的绑定导航器

它应该更新客户端信息绑定源的当前对象

private void updateClientInfo(object sender, EventArgs e)
{
    clientInfoBindingSource.Position = clientInfoBindingSource.Find("ClientID",ClientIDTextBox.Text);
}
在列表的最后一项上,它正在正确更新我的所有文本框,但下拉软件框将为空

下面是组合框的自动生成代码

// 
// softwareComboBox
// 
this.softwareComboBox.DataBindings.Add(new System.Windows.Forms.Binding("SelectedItem", this.clientInfoBindingSource, "Software", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.softwareComboBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.clientInfoBindingSource, "Software", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));
this.softwareComboBox.FormattingEnabled = true;
this.softwareComboBox.Location = new System.Drawing.Point(106, 234);
this.softwareComboBox.Name = "softwareComboBox";
this.softwareComboBox.Size = new System.Drawing.Size(220, 21);
this.softwareComboBox.TabIndex = 23;
任何指向正确方向的指针。 此数据源绑定到从SQL server自动生成的数据集

填写主窗体加载时的下拉列表

this.clientSoftwareTableAdapter.Fill(this.clientsDataSet.ClientSoftware);
softwareComboBox.Items.AddRange(this.clientscDataSet.ClientSoftware.Select(a => a.Software).ToArray());

编辑--将上述代码更改为使用DataSourceUpdateMode.OnPropertyChanged,但它不会影响行为。

一眼:我会尝试将
DataSourceUpdateMode
设置为
OnPropertyChanged

我承认失败,只会将组合框更改为文本框,我不知道这个问题是否仍然有效,但您是否尝试过:

softwareComboBox.DataSource = this.clientsDataSet.
                                      ClientSoftware.
                                         Select(a => a.Software).ToArray();

与手动添加项目不同?

我将不得不重新处理这个问题。你不会有一个可运行的例子来显示这个问题,你有一个电子邮件地址给你一些源代码块吗?我不想公开发表。
softwareComboBox.DataSource = this.clientsDataSet.
                                      ClientSoftware.
                                         Select(a => a.Software).ToArray();