Have a field in ViewModel:
[Required]
[UIHint("ValueViewTemplate")]
[Display(Name = "Approval Type")]
public int ApprovalTypeId { get; set; }
||||||||||||||||||||||||||||||||||||||||||||||||||||
Using GridEditMode.PopUp:
||||||||||||||||||||||||||||||||||||||||||||||||||||
ValueViewTemplate is:
@model object
@(Html.Kendo().DropDownListFor(m => m)
.DataValueField("Id")
.DataTextField("Value")
.OptionLabel("- Select -")
.BindTo((System.Collections.IEnumerable)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)])
.Template("<span class=\"drop-down-list-item\" title=\"#=Value#\">#=Value#</span>")
)
||||||||||||||||||||||||||||||||||||||||||||||||||||
Works, but only problem is the label is not showing "Approval Type" from [Display(Name = "Approval Type")] of the viewmodel, but the actual field name of ApprovalTypeId.
What should one do..? First time using Grid control... thnks.