thread796-987057
VB.NET Win forms issue with combo. I have a combo-box filled with sql from a database which has duplicate DisplayMember values and after selecting the second value of duplicate values then returning to the combo and hitting the drop down arrow it always highlights the first row of the duplicate rows and not the one I selected. E.g. my sql could be SELECT ID, Name, Code. My ValueMember is ID (and I hide this column in code) and DisplayMember is Name. My data could be for e.g.:
1, 'Bob Brown', 'Bob'
2, 'David Smith', 'Dav'
3, 'David Smith', 'Dav2'
When I select item 3 ('Dav2') and click somewhere else on my form then click back on the combo and hit the drop down arrow I see that item 2 ('Dav') has been highlighted. If I do nothing (i.e. do not select anything) and click somewhere else on the form it indeed selects item 2. In my click event of the combo I set other fields based on the selection of my combo so it is obvious the value has changed. So am I doing the impossible, i.e. if the DisplayMember has duplicates the combo automatically shows the item selected by DisplayMember and Not ValueMember on dropping down. Is there any other information you need from me.
VB.NET Win forms issue with combo. I have a combo-box filled with sql from a database which has duplicate DisplayMember values and after selecting the second value of duplicate values then returning to the combo and hitting the drop down arrow it always highlights the first row of the duplicate rows and not the one I selected. E.g. my sql could be SELECT ID, Name, Code. My ValueMember is ID (and I hide this column in code) and DisplayMember is Name. My data could be for e.g.:
1, 'Bob Brown', 'Bob'
2, 'David Smith', 'Dav'
3, 'David Smith', 'Dav2'
When I select item 3 ('Dav2') and click somewhere else on my form then click back on the combo and hit the drop down arrow I see that item 2 ('Dav') has been highlighted. If I do nothing (i.e. do not select anything) and click somewhere else on the form it indeed selects item 2. In my click event of the combo I set other fields based on the selection of my combo so it is obvious the value has changed. So am I doing the impossible, i.e. if the DisplayMember has duplicates the combo automatically shows the item selected by DisplayMember and Not ValueMember on dropping down. Is there any other information you need from me.