Sorry if I didn't make myself clear. I am not wanting to bind the typed list to the dropdown. I am wanting to populate a dropdown with a list of the field names. For example the generated enum:
''' <summary>
''' Index Enum To fast-access TypedList Fields In the Columns collection of the Typed List: ProspectList
''' Auto-generated, Do Not modify.
''' </summary>
Public Enum ProspectListTypedListFieldIndex
ProspectID
FirstName
MiddleName
LastName
City
State
RecontactDate
DateLastCommunication
Recruiter
AmountOfFields
End Enum
I want to use this dropdown to build the predicate factory to limit rows returned in my typed list. I tried using: DropDownList1.DataSource = ProspectListTypedListFieldIndex but "'ProspectListTypedListFieldIndex' is a type and cannot be used as an expression."
The code I finally came up with is:
Dim v As Integer
Dim i As ListItem
For Each v In [Enum].GetValues(GetType(ProspectListTypedListFieldIndex))
i = New ListItem
i.Value = v.ToString
i.Text = [Enum].GetName(GetType(ProspectListTypedListFieldIndex), v)
DropDownList1.Items.Add(i)
Next
Is there an easier way?