Hello - I have trouble getting an inline dropdownlist to display in my grid. I believe I have followed the examples out there, but I must be missing something. Any help would be a appreciated. When I run the app this is what I "undefined" in the cells that use a dropdownlist editor and when I click on the cell to edit a text box opens up instead of a drop down list.
Here is my setup. (non relevant elements removed).

Here is my setup. (non relevant elements removed).
@(Html.Kendo().Grid<ETModel.Areas.Admin.Models.EventTriggerGridItem>()
.Name("TriggerItems")
.Columns(columns =>
{
columns.Bound(p => p.TriggerAction).ClientTemplate("#=TriggerAction.TriggerActionName#").Sortable(false).Filterable(false).Width(150);
columns.Command(command => command.Custom("Delete").Click("deleteEventTrigger")).Width(95);
})
.PersistSelection()
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Selectable()
.ClientDetailTemplateId("TriggerDetailTemplate")
.Scrollable(s => s.Height("auto"))
.Resizable(r => r.Columns(true))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.Events(events => events.Error("error_handler").RequestStart("hide_validation"))
.Model(model =>
{
model.Id(p => p.EventTriggerID);
model.Field(p => p.TriggerAction).DefaultValue(ViewData["DefaultTriggerAction"] as GridLookupItem).Editable(true);
})
.Read(read => read.Action("EventTriggerGrid_Read", "ETModelManager", new { emodelid = Model.EModelID }))
.Update(update => update.Action("EventTriggerGrid_Update", "ETModelManager"))
.Destroy(destroy => destroy.Action("EventTriggerGrid_Delete", "ETModelManager"))
)
)
Model...
// ETModel Builder Grid Support Classes
public class TriggerAction
{
public string TriggerActionID { get; set; }
[UIHint("TriggerAction")]
public string TriggerActionName { get; set; }
}
public class EventModelView
{
public List<TriggerAction> TriggerActionList { get; set; }
public EventModelView()
{
TriggerActionList = new ModelSelectList().GridSelectList("[etm].usp_EventModelDB_GetTriggerActionList").Select(x => new TriggerAction
{
TriggerActionID = x.ID,
TriggerActionName = x.Name,
}).ToList();
}
}
Controller...
ViewData["TriggerActionList"] = emodelview.TriggerActionList;
ViewData["DefaultActionList"] = emodelview.TriggerActionList.First();
Editor Template
@model ETModel.Areas.Admin.Models.EventModelView
@(Html.Kendo().DropDownListFor(m => m)
.Name("TriggerAction")
.DataValueField("TriggerActionID")
.DataTextField("TriggerActionName")
.BindTo((System.Collections.IEnumerable)ViewData["TriggerActionList"])
.OptionLabel("Select...")
.HtmlAttributes(new { @class = "w-100" })
)