This is a migrated thread and some comments may be shown as answers.

EnumDropDownListFor

1 Answer 184 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Waz
Top achievements
Rank 1
Waz asked on 09 May 2016, 04:47 AM

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 :-)

 

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 10 May 2016, 12:37 PM
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!
 
Tags
DropDownList
Asked by
Waz
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or