1

I'd like my enum's to generate combo boxes, instead of plain input fields. Just like when we include related classes from other - those are pickable from a list.

How can I do that automatically? I know how to do that from the code but I'd like the automatic code generator for a view to do that for me.

Is it at all possible?!

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
  • 5
    See this answer: http://stackoverflow.com/a/9166665. Then you just need to create an editor template called `Enum.cshtml` that builds your combo box from the enum members. – Ant P May 11 '14 at 17:14
  • There are several same questions: http://stackoverflow.com/questions/388483/how-do-you-create-a-dropdownlist-from-an-enum-in-asp-net-mvc http://stackoverflow.com/questions/4656758/mvc3-razor-dropdownlistfor-enums – Dmitry Zaets May 12 '14 at 14:38

0 Answers0