Advertisement

07.20.2008 at 02:16AM PDT, ID: 23579911
[x]
Attachment Details

ComboBox values will not show correctly after update.

Asked by capt_alberta in .Net Editors & IDEs, Microsoft Visual Basic.Net

Tags: VB.Net

Experts,

I'm trying to databind three comboboxes to a datatable (dt).  See the code snippet below.

After I update the combobox values, they all display the first item in the list (not the selected value as intended.)  However, reloading the datatable shows that the selected items were indeed saved to the underlying database.

Is there something I'm missing.  I've got to have the selected values display when they are saved.



Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
lbAgentID.DataBindings.Add("Text", dt, "AgentPK")
dtpPwdExpiry.DataBindings.Add("Value", dt, PwdExpiry")
cbTeam.DataBindings.Add("SelectedValue", dt, "TeamFK")
cbLocation.DataBindings.Add("SelectedValue", dt, "LocationFK")
cbSecurityLevel.DataBindings.Add("SelectedValue", dt, "SecurityLevelFK")
tbFirstName.DataBindings.Add("Text", dt, "FirstName")
tbLastName.DataBindings.Add("Text", dt, "LastName")
tbUserName.DataBindings.Add("Text", dt, "UserName")
tbPassword.DataBindings.Add("Text", dt, "Password")
chkActive.DataBindings.Add("CheckedValue", dt, "Active")
[+][-]07.20.2008 at 06:00PM PDT, ID: 22047593

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Microsoft Visual Basic.Net
Tags: VB.Net
Sign Up Now!
Solution Provided By: capt_alberta
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628