Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple Combobox with dropdown
Message
 
À
21/11/2002 12:33:19
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00724122
Message ID:
00725384
Vues:
16
Bonnie, you are right

As I've posted the DataBindings.Add method, I was linking the combo values to the dataset field, and those values do not get initialized when you load the combo via .AddRange

The correct form of the DataBindings.Add, in my posted example, would be
comboBox1.DataBindings.Add(
    new System.Windows.Forms.Binding(
        "SelectedItem", myDataSet, "Employee.Prefix"));
The difference is "SelectedItem" instead of "SelectedValue"; this works because the Items collection is populated by the AddRange method.

Thanks for the comment,
Jose

>Jose,
>
>For some reason, I've had trouble doing this (coded it exactly like you show, except C# instead of VB). It just wouldn't databind, so I ended up creating a DataSet and filling my combo from that. That worked.
>
>~~Bonnie
>
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform