DropDownList parse value and text from single field?

1 posts, 0 answers
  1. littleGreenDude
    littleGreenDude avatar
    17 posts
    Member since:
    Jan 2014

    Posted 23 Jun 2014 Link to this post

    When using the Kendo DropDownList, is there a way to parse the value and text fields from a single datasource field?  Possibly using templates (or is the template for display only)?


    Html.Kendo().DropDownList()
       .AutoBind(false)
       .Name("cboSearchCriteria")
       .Template("#:Value#|#:Key#")
       .DataTextField("Value")
       .DataValueField("Key")
       .DataSource(ds => ds.Read(read => read.Action("FilterSearchResults", "User")))   
           )


    DataSource is receiving a list of strings back from "FilterSearchResults".

    "AAAAAA|1"
    "BBBBBB|2"
    "CCCCC|3"

Back to Top