By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,490 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,490 IT Pros & Developers. It's quick & easy.

Multiple combo boxes bound to the same datatable

P: n/a
I have what I thought was a relatively simple data situation that I can't
seem to get working using ADO.NET datasets and data binding.
I have an "Issues" table which records the UserID of the user that opens,
closes and is assigned to the Issue. These come from the same group of
users, so they are all related to a "Users" table. I have three combo boxes
on a form. I set up the binding as shown below. It works when the form is
loaded, but when I change one of the combo boxes, they all change. Based on
what I've read, I believe I need a different BindingManagerBase for each
combo box, but I've been unable to find an example of how to actually do
this. Can anyone help?

'Closed By
cboClosedBy.DataSource = dsAppData.Tables("Users")
cboClosedBy.DisplayMember = "UserName"
cboClosedBy.ValueMember = "UserID"
cboClosedBy.DataBindings.Add("SelectedValue", dvIssue, "ClosedBy")
'Opened By
cboOpendBy.DataSource = dsAppData.Tables("Users")
cboOpendBy.DisplayMember = "UserName"
cboOpendBy.ValueMember = "UserID"
cboOpendBy.DataBindings.Add("SelectedValue", dvIssue, "OpenedBy")
'Assigned To
cboAssignedTo.DataSource = dsAppData.Tables("Users")
cboAssignedTo.DisplayMember = "UserName"
cboAssignedTo.ValueMember = "UserID"
cboAssignedTo.DataBindings.Add("SelectedValue", dvIssue, "AssignedTo")
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This question is best answered in the adonet newsgroups.

OHM
Young J. Putt wrote:
I have what I thought was a relatively simple data situation that I
can't seem to get working using ADO.NET datasets and data binding.
I have an "Issues" table which records the UserID of the user that
opens, closes and is assigned to the Issue. These come from the same
group of users, so they are all related to a "Users" table. I have
three combo boxes on a form. I set up the binding as shown below. It
works when the form is loaded, but when I change one of the combo
boxes, they all change. Based on what I've read, I believe I need a
different BindingManagerBase for each combo box, but I've been unable
to find an example of how to actually do this. Can anyone help?

'Closed By
cboClosedBy.DataSource = dsAppData.Tables("Users")
cboClosedBy.DisplayMember = "UserName"
cboClosedBy.ValueMember = "UserID"
cboClosedBy.DataBindings.Add("SelectedValue", dvIssue, "ClosedBy")
'Opened By
cboOpendBy.DataSource = dsAppData.Tables("Users")
cboOpendBy.DisplayMember = "UserName"
cboOpendBy.ValueMember = "UserID"
cboOpendBy.DataBindings.Add("SelectedValue", dvIssue, "OpenedBy")
'Assigned To
cboAssignedTo.DataSource = dsAppData.Tables("Users")
cboAssignedTo.DisplayMember = "UserName"
cboAssignedTo.ValueMember = "UserID"
cboAssignedTo.DataBindings.Add("SelectedValue", dvIssue, "AssignedTo")

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.