Solved

Problems with Bound Combobox VS.NET - Cannot select item

Posted on 2007-11-27
7
312 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

809 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