Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple Combobox with dropdown
Message
 
To
21/11/2002 12:33:19
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00724122
Message ID:
00725384
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform