I have a State class defined like this:
Public Class State
Public Property StateId As Integer
Public Property Name As Dictionary(Of Integer, String)
End Class
Name(x) contains the state name in different languages.
I get a collection of State from the method StateManager.GetAllStates() and I want to bind this collection to a DropDownList. The problem is that I can't find how to set the DataTextField property to let's say stateList.Name(1) which is the english name of my state.
Dim stateList As StateCollection = StateManager.GetAllStates()
Me.DataSource = stateList
Me.DataValueField = "StateId"
Me.DataTextField = "Name(1).Value" <-- Problem here
Me.DataBind()
Anyone have an idea?
Thanks