Binding controls to a list of simple datatypes

2 posts, 0 answers
  1. Nikita
    Nikita avatar
    14 posts
    Member since:
    Apr 2013

    Posted 03 Oct 2016 Link to this post

    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("?")

  2. Nikita
    Nikita avatar
    14 posts
    Member since:
    Apr 2013

    Posted 03 Oct 2016 Link to this post

    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.
Back to Top