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

cbo Prob. I have to click an item twice in a combobox to get it to stay.

P: n/a
I have a combobox. Currently with two values. The box is bound to a dataset.
Once the form is loaded and I select the second value, the first\original
value stays in the combobox. If I drop it down again and select the second
value then the second value stays. If I close the form and reopen it the box
works correctly.

Here is the sub that binds of the combobox

Sub LoadTradingPartners()
Dim strSQLTradingPartnerList As String = "Select yadda yadda yadda"

Dim cmdIDList As New SqlClient.SqlCommand(strSQLTradingPartnerList, EDIConn)
SQLDataAdptr.SelectCommand = cmdIDList
dsTP = New DataSet("TPList")

cboTP.DataSource = dsTP.Tables.Item("TPIDs")
cboTP.DisplayMember = "TP_NAME"
cboTP.ValueMember = "TP_CODE"

'Bind the data to the controls
cboTP.DataBindings.Add("SelectedValue", dsTP.Tables("TPIDs"), "TP_CODE")
txtFTPInput.DataBindings.Add("TEXT", dsTP.Tables("TPIDs"),

End Sub
This procedure is called from the Load event of the form.

Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.