Combobo hidden value

MCas86

New member
Joined
Feb 13, 2010
Messages
3
Programming Experience
3-5
I have a combobox populated from the DB with:
ID
State
Tax

State is the only value that is shown.
I'm trying to get the hidden value, Tax, from the combobox based on the selection but can't figure it out. Thanks.
 
You should be able to cast the ComboBox.SelectedItem to your class and access the ID and Tax properties from there
 
Ctype() and DirectCast()
VB.NET:
Dim CurrItem As YourClass = CType(ComboBox1.SelectedItem, YourClass)
CurrItem.Tax
CurrItem.ID
'etc...
 
Back
Top