When trying to edit a simple object that is part of my model in a grid in popup edit mode the dropdownlist editor doesn't appear. It does appear when the grid is in inline edit mode. Below is the relevant code snippets from a sample project I created to reproduce this behavior. I can attach the sample project if need be.
public class OrderModel
{
public int OrderNumber { get; set; }
public int Quantity { get; set; }
public string Item { get; set; }
[UIHint("SupplierEditor")]
public SupplierModel Supplier { get; set; }
}
public class SupplierModel
{
public int SupplierID { get; set; }
public string SupplierName { get; set; }
}
@model KendoUIMvcApplication2.Models.SupplierModel
@(Html.Kendo().DropDownList().Name("cboSupplier")
.DataTextField("SupplierName")
.DataValueField("SupplierID")
.DataSource(d => d
.Read("GetSuppliers", "Home")
)
)
@(Html.Kendo().Grid<KendoUIMvcApplication2.Models.OrderModel>().Name("gridOrdersPopup").Columns(c =>
{
c.Bound(model => model.OrderNumber).Title("Order #");
c.Bound(model => model.Item);
c.Bound(model => model.Quantity);
c.Bound(model => model.Supplier).ClientTemplate("#= Supplier.SupplierName #");
c.Command(command => { command.Edit(); command.Destroy(); });
})
.DataSource (d => d
.Ajax()
.ServerOperation(false)
.Read(read => read.Action("GetOrders", "Home"))
.Create(update => update.Action("CreateOrder", "Home"))
.Update(update => update.Action("UpdateOrder", "Home"))
.Destroy(update => update.Action("DeleteOrder", "Home"))
.Model(model => model.Id(m => m.OrderNumber))
)
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.ToolBar(toolbar => toolbar.Create())
.Selectable(s => s.Mode(GridSelectionMode.Single))
.Sortable()
.Scrollable(s => s.Height(200))
.Resizable(resize => resize.Columns(true))
)
public class OrderModel
{
public int OrderNumber { get; set; }
public int Quantity { get; set; }
public string Item { get; set; }
[UIHint("SupplierEditor")]
public SupplierModel Supplier { get; set; }
}
public class SupplierModel
{
public int SupplierID { get; set; }
public string SupplierName { get; set; }
}
@model KendoUIMvcApplication2.Models.SupplierModel
@(Html.Kendo().DropDownList().Name("cboSupplier")
.DataTextField("SupplierName")
.DataValueField("SupplierID")
.DataSource(d => d
.Read("GetSuppliers", "Home")
)
)
@(Html.Kendo().Grid<KendoUIMvcApplication2.Models.OrderModel>().Name("gridOrdersPopup").Columns(c =>
{
c.Bound(model => model.OrderNumber).Title("Order #");
c.Bound(model => model.Item);
c.Bound(model => model.Quantity);
c.Bound(model => model.Supplier).ClientTemplate("#= Supplier.SupplierName #");
c.Command(command => { command.Edit(); command.Destroy(); });
})
.DataSource (d => d
.Ajax()
.ServerOperation(false)
.Read(read => read.Action("GetOrders", "Home"))
.Create(update => update.Action("CreateOrder", "Home"))
.Update(update => update.Action("UpdateOrder", "Home"))
.Destroy(update => update.Action("DeleteOrder", "Home"))
.Model(model => model.Id(m => m.OrderNumber))
)
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.ToolBar(toolbar => toolbar.Create())
.Selectable(s => s.Mode(GridSelectionMode.Single))
.Sortable()
.Scrollable(s => s.Height(200))
.Resizable(resize => resize.Columns(true))
)