Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmCombobox binding question
Message
De
22/07/2003 13:29:42
Ali Ihsan Turkoolu
Galaksi Bilgisayar A.Þ.
Ankara, Turquie
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00812258
Message ID:
00812442
Vues:
13
Mr. McNeish,

When I applid as you describe, synchronization problem occured. Both combobox shows the same city.

When I do as follow, problem solved.
1. HeadOfficeCity combo box:

BindingSource: Cities
BindingSourceDisplayMember: city_name
BindingSourceValueMember: city_id

BindingValueSource: Customer
BindingValueSourceMember: HeadOfficeCity_id

2. ShipCity combo box:

BindingSource: Cities
BindingSourceDisplayMember: Cities.DefaultView.city_name
BindingSourceValueMember: city_id

BindingValueSource: Customer
BindingValueSourceMember: ShipCity_id

Note: I haven't add any code to my Cities business object.

If I were need one more Combobox, I think I should use mmDataSet and add one DataView in my Cities business object, and I will use that DataView as BindingSourceDisplayMember. Is it true?

>Ali,
>
>>I have a Cities business object build on cities table which has two fields: city_id and city_name.
>>
>>I have a Customer table which has HeadOfficeCity_id and ShipCity_id fields.
>>
>>Using Cities business object as two different combo boxes, How can I control the HeadOfficeCity_id and ShipCity_id fields on the same form?
>
>You can use a single instance of the Cities business object as the binding source to fill the two combo boxes, specifying the display member and value member. You can then bind the comboboxes selected value to the Customer business object, specifying the two different value members. For example:
>
>1. HeadOfficeCity combo box:
>
>BindingSource: Cities
>BindingSourceDisplayMember: city_name
>BindingSourceValueMember: city_id
>
>BindingValueSource: Customer
>BindingValueSourceMember: HeadOfficeCity_id
>
>2. ShipCity combo box:
>
>BindingSource: Cities
>BindingSourceDisplayMember: city_name
>BindingSourceValueMember: city_id
>
>BindingValueSource: Customer
>BindingValueSourceMember: ShipCity_id
>
>Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform