EnumDropDownListFor

2 posts, 0 answers
  1. Waz
    Waz avatar
    11 posts
    Member since:
    Aug 2007

    Posted 08 May Link to this post

    Hi

    MVC 5.1 has a simple and elegant solution for Enum's and DropDownList

     

    @Html.EnumDropDownListFor(model => model.MyProp )

     

    This populates the list, it works with the [Range] DataAnnotation, and also works if the model value is NULL.   More importantly it selects the item in the list based on the Model value out-of-the-box.

    Trying to do this with Kendo is a lot more involved and messy right?

    So can we please have a Kendo.EnumDropDownListFor please to match?

    Thank you :-)

     

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 10 May Link to this post

    Hello Warren,

    Using the Kendo DropDownListFor could easily work with enum values:
    @Html.Kendo().DropDownListFor(m=>m.Sex).BindTo(YourProvider.SexListItems).Value(Model.Sex.ToString())

    Nevertheless, you could create a feature request in our public portal and if it receives enough votes our developers team will consider the possibility of such implementation:

    Best Regards,
    Konstantin Dikov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top