G
Guest
I have 2 ComboBoxes on a form bound to the same DataSet using a New
BindingContext for the second one. Both ComboBoxes need to have their
SelectedValue bound to a different DataSet . The first one works properly,
but the second one will not select any value. I am pretty sure that this has
something to do with the New BindingContext used on the second ComboBox, but
I can't get around it.
Note: The ComboBoxes are supposed to show a list of Employees (children).
And the SelectedValue is from the Contacts table. Each Contact record has 2
Employee_ID fields.
Any help would be greatly appreciated!!
With ComboBox1
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox1.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey1")
With ComboBox2
.BindingContext = New BindingContext
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox2.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey2")
BindingContext for the second one. Both ComboBoxes need to have their
SelectedValue bound to a different DataSet . The first one works properly,
but the second one will not select any value. I am pretty sure that this has
something to do with the New BindingContext used on the second ComboBox, but
I can't get around it.
Note: The ComboBoxes are supposed to show a list of Employees (children).
And the SelectedValue is from the Contacts table. Each Contact record has 2
Employee_ID fields.
Any help would be greatly appreciated!!
With ComboBox1
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox1.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey1")
With ComboBox2
.BindingContext = New BindingContext
.DataSource = ds2
.DisplayMember = "Initials"
.ValueMember = "PrimaryKey"
End With
ComboBox2.DataBindings.Add("SelectedValue", ds1, "ChildPrimaryKey2")