Avatar of Glen Gibb
Glen GibbFlag for Canada

asked on 

ComboBox values will not show correctly after update.

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.




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

Open in new window

Editors IDEsVisual Basic.NET

Avatar of undefined
Last Comment
Glen Gibb
ASKER CERTIFIED SOLUTION
Avatar of Glen Gibb
Glen Gibb
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo