Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to take advantage of ListBox.ValueMember
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
How to take advantage of ListBox.ValueMember
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01209815
Message ID:
01209815
Views:
111
This relates to my other posting.

I'm developing a WinForms application that uses a ListBox. The listbox is populated from the Sessions table of my database. There are two fields in this table that I am particularly interested in: 'date' (this is the field I want displayed in the ListBox), and SessionID (the primary index of the record in the Sessions table containing that date). When the user selects a date in the ListBox, I want to retrieve the corresponding SessionID.

I was under the impression that the ValueMember property of the ListBox would enable me to do this.

I have set the "DisplayMember" propery of the ListBox to the date field, and the "ValueMember" property to the sessionid field.

How do I get the SessionID value when the user selects a date in the ListBox?

Thanks,
Jim
Next
Reply
Map
View

Click here to load this message in the networking platform