Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databinding a Combobox in c#
Message
 
À
20/03/2003 11:00:00
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00767936
Message ID:
00769021
Vues:
18
if I have a 2 dime array what do i bind it to in the combobox? value, valuemember,displaymember, text ?

Regards,


>Fred,
>
>The problem with binding to a one-dimensional array ... you have something to display, but not to bind an integer value to. Try creating a DataTable with two columns to fill the combo with.
>
>~~Bonnie
>
>
>>Hi guys,
>>I have a combo box on a windows form. It is populated with an arraylist
>> private ArrayList laarraylist
>>laarraylist = new ArrayList()
>>laarraylist.Add("Weekly");
>>laarraylist.Add("Monthly");
>>laarraylist.Add("Yearly");
>>
>>ComboBox1.DataSource = laarraylist
>>
>>I have a Dataset with an integer field. the field can be 1,2 or 3.
>>
>>How do I bind the data from the dataset to the combobox.
>>
>>I have tried the foll
>>
>>ComboBox1.DataBindings.Add(new Binding("Text",ds,"Client.Period"))
>>
>>when I view the form the Combo box is always displaying the first item (Weekly"). can Anyone see anything wrong with this code. I need your help please .
>>
>>Regards,
>>
>>Fred
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform