I have a class called optionCode:
Class optionCode
Public description As String
Public optCode As String
End Class
I have a query the returns a list of this optionCode class:
Dim _SelectActiveOptionCodes2 = (From _OptCodes In _EntityModel.tblOptionCodes
Where _OptCodes.fdStatus = "A"
Select New optionCode With {.description = _OptCodes.fdDescription,
.optCode = _OptCodes.fdOptionCode}).ToList()
I want to use this list to populate a listbox where the description is the display field and the option code is the value field.
When using:
sortableOptionCodes = _SelectActiveOptionCodes2
sortedOptionCodes = _SelectActiveOptionCodes2
OptionCodeListBox.DataSource = sortedOptionCodes
The listbox populates, but every entry is "OptionCodeSearch.Form1+optionCode"
I can't figure out how to use the .ValueMember and .DisplayMember functions to get the listbox to load the way I want.