I have a grid and I'm doing inline editing. I have a property in my model that is an enum. Using the Display() attribute on the enum works great for rendering the grid. But when I go to edit a row I have not been able to get a dropdownlist with the enum values to display.
I have a partial view in the EditorTemplates for the enum.
@model Dashboard.Web.Models.Schedule @(Html.Kendo().DropDownListFor(m => m.GotoType) .DataTextField("Text") .DataValueField("Value") .BindTo(Html.GetEnumSelectList(typeof(Dashboard.Web.Models.GotoType))) .Deferred() )
My model I have the UIHint attrbute on the enum property.
public class Schedule
{
[Key]
public int Id { get; set; }
[Display(Name = "Go To ")]
[UIHint("GotoTypeEditor")]
public GotoType GotoType { get; set; }
[ForeignKey("Location"), Display(Name = "Location")]
public int LocationId { get; set; }
public Location Location {get; set;}
}
What do I need to do in the Kendo.Grid? I tried adding the EditorTemplateName this did not work. Do i need to do something in the datasource.Model definition?
I have the dropdownlist displaying in the grid now. I changed the bindTo to Html.GetEnumSelectList<Dashboard.Web.Models.GotoType>(). But the data binding to my model property is not working.