Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two ComboBoxes one datasource
Message
De
19/08/2009 04:14:53
 
 
À
19/08/2009 02:00:48
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Application:
Desktop
Divers
Thread ID:
01418478
Message ID:
01418875
Vues:
42
>>>What do you do if you need to bind that back to the data?
>
>What you fill the ComboBox with (setting the DataSource) and what you bind the user's choice to (setting the DataBindings) are two different things. Making a choice in the combo, saves the choice to the databound table, which is not the same table as what is used to fill the combo (the DataSource).
>
>Oh, and BTW ... setting the DataSource for two different Combos to MyTable.Copy() for each one *is* the correct way to handle this situation.

Hi,
I'd question whether creating an additional copy of the table is always the best option. Since the ComboBox is only going to use a couple of fields it many cases might it not be more efficient to create a more lightweight source? (That said I'm immersed in WPF databinding and EntityFramework so my recollection of WinForms binding is admittedly vague :-{ )
Best,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform