DropDownLists and Prefixes

2 posts, 0 answers
  1. FlexDigital
    FlexDigital avatar
    5 posts
    Member since:
    Jul 2012

    Posted 18 Apr 2013 Link to this post

    Hey guys,

    I'm using a standard MVC Kendo DropDownList on a partial view.

    I have a ViewData.TemplateInfo.HtmlFieldPrefix set

    The problem is that the initial value that is set in the model doesn't get transferred to the dropdown when it is rendered. As soon as I take away the prefix it works fine.

    @(Html.Kendo().DropDownListFor(o => o.CCInfo.CCExpireMonth)

    At the suggestion of a few other posts here I've found that I can set .Value() explicitly to set the value.

    Using .Name() also allows the initial value to be set if I set it to "CCInfo.CCExpireMonth" rather than with the prefix (apart from the fact that now it doesn't have a prefix so it doesn't play nice with the rest of my form)

    Note: This does not affect the actual javascript version, only the MVC wrapper. In fact even copy/pasting the output from the MVC wrapper (input & script tags) directly into the html (albeit, having to set the prefix into the id/name explicitly), makes it work as expected.

    I know I can use these solutions, but I was wondering if there was any sort of fix or update coming up for this bug.

    Edit: I should also note that I am using the latest update (v2013.1.319)
  2. Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 22 Apr 2013 Link to this post

    Hello Bo,

    There is a known issue related with BindTo method and set value. I will suggest you download the latest internal build and give it a try. Let me know if the problem still persists.

    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top