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

Binding controls to a list of simple datatypes

1 Answer 308 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Nikita
Top achievements
Rank 1
Iron
Nikita asked on 03 Oct 2016, 09:53 PM

I'm trying to bind a MultiSelect to a list of strings. How do I write an data-binding expression for DataTextField and DataValueField?

@model List<string>

@Html.Kendo().MultiSelect().BindTo(Model).DataTextField("?").DataValueField("?")

1 Answer, 1 is accepted

Sort by
0
Nikita
Top achievements
Rank 1
Iron
answered on 03 Oct 2016, 09:57 PM
Hmm, just as I posted this I found the answer. Simply don't specify either text or value fields. I will bind both text and value fields to the value of the string object by default.
Tags
MultiSelect
Asked by
Nikita
Top achievements
Rank 1
Iron
Answers by
Nikita
Top achievements
Rank 1
Iron
Share this question
or