By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,457 Members | 1,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,457 IT Pros & Developers. It's quick & easy.

Having a problem using combobox in bound tables in Vs2005 Winforms

P: n/a
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
Aug 8 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Disregard, continued playing around withe them and found it.
Thanks
"Robert Dufour" <bd*****@sgiims.comwrote in message
news:Oc**************@TK2MSFTNGP06.phx.gbl...
>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

Aug 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.