Having a problem using combobox in bound tables in Vs2005 Winforms

R

Robert Dufour

I have a table of addresses and it contains a CountryId which points to a
table of countries. The datatstructure of the Countries Lookup tables is
actually created from three tables - a CountryIdtable - a Countries
localized tables and an cultures tables From which I extract a dataset
select CountryID - CountryName - Culture name (with inner joins between the
three) where CultureName = CurrentCulture.CurrentUiCulture.tostring. So I
would see the data in the datatset used fro the country lookups as follows
if the UI was in english,
1, Canada, en-US
1, US, en-US

In french I woud see
1, Canada, fr-CA
1, États-Unis, fr-CA

I created a form, on which I placed the textboxes for the addresses various
fields and a combobox for the countries. I have a dataset for the companies,
a binding source and a binding navigator as well as a tableadapter for the
companies. The textboxes get bound automatically to the
CompaniesBindingSource, and that seems to work fine.

I also have a dataset for the Countries , There is a table adapter for the
countries . These got create automatically when I placed a grid to show the
countries on the form (I wanted to see if the countries got filled up
corrcetly with records for the correct Culture, they do.)

Now for the problem. I had the countryID field in table countries configured
to use a combobox. When the combobox got created it bound the selectedItem
to the CompaniesBindingSource - CountryId which seems correct. I then went
in and set the datasource to the Countries dataset, the DisplayItem to the
CountryName and the ValueItem to the CountryId. I automatically fill the
dataset for the countries on the form load event then the dataset for the
addresses, before filling the datatset for the addresses.

The problem is that the combobox shows the name of the Country OK but as
soon as I click on the down arrow of the Combobox, all my other controls on
the form freeze, all I can do is close the form using the cross in upper
right hand corner.

What am I doing wrong, Is there somewhere a sample form that I can look at
that does what I am trying to do?

Thanks for any help.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top