I have this enum:
public enum PayTerms
{
[Display(Name = "30")]
_30 = 1,
[Display(Name = "60")]
_60,
[Display(Name = "90")]
_90,
[Display(Name = "120")]
_120,
CAD
}
Using this template I manage to create dropdown list with proper names:
@model PayTerms?
<div class="k-edit-label">@Html.LabelFor(x => x)</div>
<div class="k-edit-field">
@(Html.Kendo().DropDownListFor(m => m)
.BindTo(EnumHelper.GetSelectList(typeof(PayTerms)))
.OptionLabel("-- Select --"))
</div>
But I have problems with binding. Currently for each value for my enum property selected value in dropdown is "--Select--" How can I bind selected value for the dropdown to enum value?
UPDATE:
Also I have tried EnumHelper.GetSelectList(typeof(Erp.Shared.Contract.PayTerms), Model.Value)
but also have no luck