Solved

Problems with Bound Combobox VS.NET - Cannot select item

Posted on 2007-11-27
7
314 Views
Last Modified: 2013-11-26
I have a bound combobox on a form. The combobox is populated from another table. Here is code for populating:

I have tried both this:
==================================================
Dim dvClients as new Dataview(me.fEdge_Dataset.tblOrganization)
me.ccClientInfoCombobox.DataSource = dvClients
me.ccClientInfoCombobox.DisplayMember = "pkOrganizationID"
me.ccClientInfoCombobox.ValueMember = "OrganizationOwnerName"

and this:
==================================================
        Me.CcClientInfoComboBox.DataBindings.Add(New System.Windows.Forms.Binding("Text",  Me.Gen_AppraisalMainBindingSource1, "ccClientInfo", True))
        Me.CcClientInfoComboBox.DataBindings.Add(New System.Windows.Forms.Binding("SelectedValue",  Me.Gen_AppraisalMainBindingSource, "ccClientInfo", True))
        Me.CcClientInfoComboBox.DataSource = Me.TblOrganizationBindingSource
        Me.CcClientInfoComboBox.DisplayMember = "OrganizationOwnerName"
        Me.CcClientInfoComboBox.ValueMember = "pkOrganizationId"

pkOrganizationalID is an identity number.
Organizationownername is a text value.

The box populates with no problem. I can select a value with no problem. I then cannot leave the combobox.

If I type in a numeric value in the box, I can leave the combobox and populate others. Alternately, if I change the display member to the ID value in my code, I can select a value and leave the box.

This has me baffled. Any help at all is appreciated.

Vee
0
Comment
Question by:VeeVan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 11

Expert Comment

by:AkisC
ID: 20360393
A time saver rule of thumb I have come up, working with microsoft products, is...
When I face peculiar behavior with controls, the first thing I do, is DELETE the control, save the form, close my App and re-open it again. THEN I create another control and if possible (few ajustments in my code) I give it another name...
0
 
LVL 1

Author Comment

by:VeeVan
ID: 20361612
I have deleted and recreated it more times than I can count. I followed your exact instructions and still the same result. There MUST be something I am doing wrong, but can't figure it.
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20361692
Ok.
From the built menu
click ->Clean Solution
-then-
->RE-building solution (not built)

I hope I am not waisting your time, bacause I find no reasoning in the error you get. The code looks ok.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:VeeVan
ID: 20361926
Yeah... I have cleaned many many times.
I found the solution.

There is another person who had this issue: here is the link on EE.
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_21724117.html?sfQueryTermInfo=1+bound+combobox

The way I fixed it is I manually went into the databindings for the combobox, and made sure that all databindings were set to "none". Then I manually selected the "Selected value" for the item in the ds that I wanted. For whatever reason.... it worked. And is working now. Thanks for your help and assistance. D**N those stupid MS gizmos.
0
 
LVL 11

Expert Comment

by:AkisC
ID: 20364137
Nice you got it working

Have fun coding...
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20615323
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question