Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Boxes
Message
From
24/10/2003 13:03:31
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00841931
Message ID:
00842284
Views:
24
Jason,

After setting up the DataSource for your Combo:
MyCombo.DataSource = MyLevelsTable;
MyCombo.DisplayMember = "tLevelDescription";
MyCombo.ValueMember   = "nlLevelID";
then you'll need to DataBind the Combo's SelectedValue to your main DataSet's column, like this:
MyCombo.DataBindings.Add("SelectedValue", MyMainTable, "MyBoundColumn");
Then, when your DataSet that contains MyMainTable is loaded, the Combo will correctly reflect what has already been entered in the table.

When/if the user chooses a different item from the Combo, then the corresponding ValueMember will be stored in MyBoundColumn automatically. You can also use the MyCombo.SelectedValue to do something with that value if you need to. You can also use MyCombo.SelectedIndex, which will give you and index into the MyCombo.Items collection. (MyCombo.Items[MyCombo.SelectedIndex]).

I'm just trying to give you a brief overview about how to use a Combo ... I have no idea if you already know this stuff or not, but if I've only served to confuse you <g> let me know.

~~Bonnie


>That is correct. How do I find the index associated with the ValueMemeber I want to display?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform