I have enums in my domain like this
public enum AdTypeEnum { Sale = 1, Rent = 2, SaleOrRent = 3 };
In my view I’m rendering this enums like this
<div class="editor-field">
@Html.DropDownListFor(x => x.AdType, new SelectList(Enum.GetValues(typeof(MyDomain.Domain.Property.AdTypeEnum))))
</div>
Now, what I’m trying to achive is based on selected language I want to display these enums in drop down list in selected language.
Did you try something like:
A better implementation should use a different key-set for each enum type (using the enum name as part of the GetString() parameter).
Anyway this method is pretty naive, I think for a big application (or for more complex scenarios) you may need to inherit from SelectList class.