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")
dsTP.Tables.Add("TPIDs")
SQLDataAdptr.Fill(dsTP.Tables("TPIDs"))

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"),
"FTP_DIR_CLAIMS_INPUT")

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

Thanks,
Phillip
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.