Combobox DisplayMember & ValueMember Understanding
Posted on 2008-02-05
I'm not sure if I understand the meaning of displaymember and valuemember correctly on combobox's but in relation to my MS Access experience, I understand the first is what's displayed in the combobox and the second is what value is used when a selection is made?
I have a windows form that has a bound combobox on it and I have set the datasource to a seperate table which stores the combobox list. I then set the displaymember (and this a string (it's a name)) and the valuemember (which is a unique integer).
This shows the displaymember as required and I can select from the list - but when I attempt to move onto the next record in my dataset it will not. I assume it won't accept the string in the combobox - as it's bound to a field of integer type - and is attempting to store this integer not the valuemember string?
Not sure how well I've explained that!
Any assistance, as usual much appreciated.