Hi Veselin, I have the same problem - have applied fixes as suggested above but to no avail. I am using MVC 5.3 with Kendo version 2017 v3.
The enum dropdown is showing no option label but an empty value in the first position (representing the default int value - zero which does not exist in the enum!), all other values appear as expected. WIth standard MVC enum helpers the display work fine without this issue but I want to use yours because because of consistent styling. What is going wrong here, bug or configuration?
Would appreciate some clues
@(Html.Kendo().DropDownListFor(m => m.OwnerModal)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.OptionLabel(Resources.PleaseSelect)
.BindTo(EnumHelper.GetSelectList(Model.OwnerModal.GetType(), Model.OwnerModal))
.Events(e =>
{
e.Select(
"ApprovalProcessController.selectOwnerModal"
);
})
)
public enum ApprovalOwnerType
{
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Party", ResourceType = typeof(Resources.Resources))]
Party = 1,
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Contract", ResourceType = typeof(Resources.Resources))]
Contract = 2,
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Audit", ResourceType = typeof(Resources.Resources))]
Audit = 3,
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Complaint", ResourceType = typeof(Resources.Resources))]
Complaint = 4,
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Financial", ResourceType = typeof(Resources.Resources))]
Financial = 5,
[System.ComponentModel.DataAnnotations.DisplayAttribute(Name="ApprovalOwner_Person", ResourceType = typeof(Resources.Resources))]
Person = 6,
}
}
//viewmodel field...nothing fancy... no constructor...
[Display(Name = "ApprovalOwner", ResourceType = typeof(Resources.Resources))]
public ApprovalOwnerType OwnerModal { get; set; }