This is a migrated thread and some comments may be shown as answers.

DropDownList parse value and text from single field?

0 Answers 6 Views
Let's talk about telerik (the good and the bad)
This is a migrated thread and some comments may be shown as answers.
littleGreenDude
Top achievements
Rank 1
littleGreenDude asked on 23 Jun 2014, 06:22 PM
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"

No answers yet. Maybe you can help?

Tags
Let's talk about telerik (the good and the bad)
Asked by
littleGreenDude
Top achievements
Rank 1
Share this question
or