Populate a combobox with collection

Posted by user228777 on Stack Overflow See other posts from Stack Overflow or by user228777
Published on 2010-03-04T18:28:08Z Indexed on 2010/05/09 5:48 UTC
Read the original article Hit count: 116

Filed under:
|

I am trying to bound combobox to a collection. Collection is returning 3 cols. How do I a specify DatavalueField and Datatextfield to 2 of the columns returned in my collection?

When I write following code Combox is populated with text showing MfnBusinessData.Item for each item.

Thanks

Dim ItemCollection As Collection(Of MfnBusinessData.Item)
    Dim oms = New MfnDataAccess.LookupDal
    ItemCollection = oms.GetLookupItems("OFXQuestionText", "FULL", "ALPHA", "en")
    RadComboBox1.DataSource = ItemCollection
    RadComboBox1.DataBind()
    'RadComboBox1.DataValueField = ItemCollection.Id
    'RadComboBox1.DataTextField = "Text"

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net