What's the Windows Form Equivalent to the ASP Drop down list
I want to download a list of names and reference numbers, display the names to the User, and from his selection read the associated reference number, but I can't see the Windows Form to do this.
I'm missing something pretty basic and deserve contempt, but would appreicate being enlightened.
Thanks in advance.
[388 byte] By [
WhoKnows] at [2007-12-16]
The problem I'm having with a combo box is as follows: I've set it's DataSource property to a DataSet that includes a Topics.Name and a Topics.TopicID column. I set the DisplayMember and ValueMember properties of the Combo box to those two columns respectively.
The combo box displays the topic name correctly, but when I access the ValueMember, I get returned the literal "Topics.TopicID" instead of the number itself.
If you could tell me how to rectify that, I'd relly apprecate it.
You would have to post your code for us to see the problem. From what you describe, it ought to work. I suspect something is not quite right about the ValueMember of the binding. Probably the ToString() method is being invoked, and it is returning the literal you see instead of useful information.