Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Boxes
Message
De
24/10/2003 01:03:03
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00841931
Message ID:
00841951
Vues:
22
Jason,

Hmmm ... let me see if I understand this correctly:

You have a ComboBox ... the user selects Mr. Jones from the Combo (the Combo.SelectedValue is a 1). Then, once you grab the data for Mr. Jones, you need another Combo that holds Levels? And you want it to display the Value of this Levels data, which in your example is a 2. Is this correct?

So, what exactly is your question? How to display the second Combo with level 2? You make the DisplayMember be the same as the ValueMember, so if you're storing the level in a column called LevelID, then you'd have:
MyCombo.DataSource = MyLevelTable;
MyCombo.DisplayMember = "LevelID";
MyCombo.ValueMember   = "LevelID";
Have I understood your question correctly?

~~Bonnie

>OK,
>
>I am trying to create a form with a combo box at the top. Once a selection is made in it I grab the ValueMember to load the rest of the form. My issue is combo boxes. I want to load a combo with all available members in it. I want to scan to the item that corresponds to the value associated with the master record. How do I do this? For example:
>
>User selects Mr. Jones with a value member of 1. When I load the master DB record for 1, Mr. Jones has a Level of 2. This corresponds to a different table that has ten levels in it. I want to allow the user to select any one of the levels, but I want the level of 2 to be displayed. This value is in the ValueMember property and not in the text.
>
>Any suggestions would be appreciated.
>
>Jason
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform