Solved

Problems with Bound Combobox VS.NET - Cannot select item

Posted on 2007-11-27
7
313 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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.

679 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