I am BATTLING to get the selected values (please note VALUES not TEXT) from a Winforms Listbox that has multi-select enabled and has been bound to a database table getting the Name (as DisplayMember) and ID (as ValueMember) - I need the ID of the selected items.
The listbox control has properties for SelectedValue
to get one of the selected items values, but not for all selected items values.
The SelectedItems
property returns a Listbox.SelectedObjectCollection
from which I cannot seem to extract the VALUES of the items.
Please help! Thanks.