DropDownList .Value() method

2 posts, 0 answers
  1. Veselin
    Veselin avatar
    1 posts
    Member since:
    Jun 2012

    Posted 13 May 2013 Link to this post

    Why the DropDownList .Value() method changes the value of the <input> element, but not displaying it. I saw that it displays some value in a <span> element that I don't know how to change. When I use DropDownListFor(x => x.UserName) I want my default value to be what I have in the Model. My question is how to set the default value of a DropDownList?
  2. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 14 May 2013 Link to this post

    Hello Veselin,

    The MVC wrapper for Kendo DropDownList widget, renders input element with the selected value. If the widget is not bound then you will not be able to see the selected text. In other words if the autoBind option is set to false, then the widget will not be bound and thus will not show the selected text. In order to achieve your goal you can either set the AutoBind(true), which is the default value, or set the text and value of the widget. I am not exactly sure what is the problem with strongly-typed extension, but you can check here.

    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!
  3. UI for ASP.NET AJAX banner
Back to Top