Configure DropDownList to not preselect the first item.

4 posts, 0 answers
  1. Chris
    Chris avatar
    5 posts
    Member since:
    Aug 2012

    Posted 14 Nov 2013 Link to this post

    How do I configure a DropDownList to show as empty when the page first loads? Whatever I try, it preselects the first item.

    I'm trying to use this as a guide, but nothing is working:

    http://demos.kendoui.com/web/dropdownlist/mvvm.html
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 15 Nov 2013 Link to this post

    Hello Chris,

     
    The DropDownList widget, like the Html Select element, has always a pre-selected option. You can use the option label to pre-select empty option or use the ComboBox widget.

    Regards,
    Georgi Krustev
    Telerik
    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 MVC is VS 2017 Ready
  4. Chris
    Chris avatar
    5 posts
    Member since:
    Aug 2012

    Posted 15 Nov 2013 Link to this post

    Ok, so the demo I linked to doesn't have a pre-selected option because it's bound to remote data, and it doesn't actually retrieve the data until you click on it?
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 18 Nov 2013 Link to this post

    Hello again Chris,

    Yes, in this case the widget is completely empty and it doesn't know which item is selected one. In general, we suggest setting value and text options if autoBind option is set to false.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready