Hi,
> Hi everybody!
>
> I have a Master Details Form with typed dataset. The master have two
> combobox. (First ComboBox is connect with a country field and the second
> is connect with the city field)
But are city and country in the same table or seperate tables ? Explain the
situation a little more, what and how many tables do you have. It's not
entirely clear.
Greetings
> The problem is that when I move the record position, the country change
> and the cities's combobox should be show the cities of the respective
[quoted text clipped - 4 lines]
> Thanks for your Help.
> Luis Rodriguez
Luis Rodriguez - 01 Feb 2006 13:56 GMT
Thanks for your Reply.
Let me explain you with another example.
I have the Three tables (Customes, Countries and cities)
The tables format are:
COUNTRIES:
Id
Description
CITIES:
Id
IdCountries
Description
CUSTOMERS:
Id
Name
Adreess
IdCity
The Cities have relation with Countries and the Customers have relation with
Cities.
Customers is a Master Table and have a combobox with the information of
cities and have another combobox with the information of countries.
If the user change the country, the cities's combobox must show the cities
of the respective country.
These ComboBoxes have binding with a bindingsource control.
The problem is that How can I filter the information of the cities's
combobox if I have binding it with bindingsource control?.
I like that When the user navigate across the records (Customers), the
comboboxes (countries and cities) take the respective information of the
table. Because when the user change the country, the information of city
must change to the respective country.
I don't know if you understand the problem. I can send you an example code.
Thanks for your help.
Luis Rodriguez
> Hi,
>
[quoted text clipped - 18 lines]
>> Thanks for your Help.
>> Luis Rodriguez
Bart Mermuys - 02 Feb 2006 10:34 GMT
Hi,
> Thanks for your Reply.
>
[quoted text clipped - 38 lines]
> I don't know if you understand the problem. I can send you an example
> code.
I think i understand what you are trying to do, but it doesn't seem easy to
get it right. If i find something i'll get back to you.
Greetings
> Thanks for your help.
> Luis Rodriguez
[quoted text clipped - 21 lines]
>>> Thanks for your Help.
>>> Luis Rodriguez
Lefty - 16 Feb 2006 01:16 GMT
If you are fetching a different city list each time, you could try
something like this:
Private Sub cboCountry_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboCountry.SelectedIndexChanged
If Not cboCountry.DataBindings("SelectedValue") Is Nothing
Then
cboCountry.DataBindings("SelectedValue").BindingManagerBase.EndCurrentEdit()
End If
cboCity.DataBindings("SelectedValue").BindingManagerBase.SuspendBinding()
cboCity.DataSource = GetCityDS(cboCountry.SelectedValue)
cboCity.DataBindings("SelectedValue").BindingManagerBase.ResumeBinding()
End Sub
Alternatively, you could assign the cboCity.DataSource to a DataView of
a DataTable of all possible cities/country pairs and then change the
DataView.RowFilter in the cboCountry.SelectedIndexChanged event to
filter out all cities except those that have the same country as the
selected country.
-Paul
> Hi,
>
[quoted text clipped - 71 lines]
> >>> Thanks for your Help.
> >>> Luis Rodriguez