Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropdown List 101
Message
De
19/05/2005 13:35:54
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
18/05/2005 20:03:42
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 1.1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Divers
Thread ID:
01015644
Message ID:
01015926
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
>I have the standard scenario:
>
>1. A lookup table, call it "Values". This table has 2 columns: Value_PKey and Value_Desc.
>
>2. A data table, with 3 columns storing foreign Value_PKey values (they will be different).
>
>I'd like to configure dropdown lists to show the current values of the 3 data columns, plus all the other available choices so each may be changed to a different value.
>
>I've gotten to the point where I can either DataBind() to a DataTable to populate the dropdown items, or spin through the DataTable and populate manually with Items.Add(). However, I don't see how to attach a separate DataSet table (or whatever) to this dropdown list.
>
>I'm probably missing something fairly fundamental. Can anyone point me to an online tutorial or code sample(s) that shows how to do this?

Al,

Binding in ASP.NET is one-way. You can use DataBind to populate dropdownlists and grids, but updates to the datasource have to be coded. In the event that performs the update (e.g. mybutton_Click, myddl_SelectedIndexChanged), use the .SelectedItem.Key property of the ddl to update the DataTable with the foreign key values.

Also, ASP.NET ddl's are not the same as comboboxes. The user will be limited to one of the choices in the lookup table.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform