I have a Hierarchical Kendo Grid that allows CRUD on the child grids. Everything works fine except if you open more than one parent grids and Add begin adding records the first record's ForeignKey column renders fine, but after the first the new records UI renders as a Textbox with a zero in it. Also, all CRUD operations are broken while there are multiple Create templates in the child grids. I attempted changing the ForeignKey column to a ClientTemplate with the DropDown contained in an editor template view, but the result was nearly the same.
I have attached a screenshot of the problem.
My parent grid:
Child Grid Template:
Thanks in advance!
I have attached a screenshot of the problem.
My parent grid:
@(Html.Kendo().Grid<
gpas.Models.ContractBillingCycleRollUpGridView
>().Name("ContractBillingCycleGrid")
.Columns(c =>
{
c.Bound(t => t.Name);
c.Bound(t => t.LineItemCount).Title("Line Item Count").Width(125).HtmlAttributes(new { name = "lineItemCount" });
c.Bound(t => t.Total).Format("{0:c}").Title("Total Budget").Width(150).HtmlAttributes(new { name = "lineItemTotal" });
c.Bound(t => t.OrganizationId).Hidden().HtmlAttributes(new { name="orgId" });
c.Bound(t => t.SubcontractorId).Hidden().HtmlAttributes(new { name = "subconId" });
})
.DataSource(ds => ds
.Ajax().Read(read => read.Action("GridBinding_ContractBillingCycleRollUp", "Contract", new { id = Model.ContractBillingCycle.Id, organizationId = Model.OrganizationId }))
)
.Sortable()
.Pageable()
.Filterable()
.ClientDetailTemplateId("contractLineItemsTemplate")
.Events(events => events.DataBound("onDataBound"))
)
<
script
id
=
"contractLineItemsTemplate"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
gpas.Models.ContractLineItemGridView
>().Name("childgrid_#=Id#_#=OrganizationId#_#=SubcontractorId#")
.Columns(c =>
{
c.ForeignKey(l => l.ExpenseCategoryId, Model.ExpenseCatagories).Title("Expense Category");
c.Bound(l => l.Description);
c.Bound(l => l.Justification);
c.Bound(l => l.Amount).Format("{0:c}").Width(200);
c.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
})
.Sortable()
.Filterable()
.Scrollable()
.ToolBar(t => t.Create())
.Editable(edit => edit.Mode(GridEditMode.InLine))
.DataSource(ds => ds
.Ajax()
.Events(events => events.Error("error_handler").RequestEnd("gridLineItem_onRequestEnds"))
.Model(model =>
{
{
model.Id(o => o.Id);
}
})
.Read(read => read.Action("GridBinding_ContractLineItems", "Contract", new { id = "#=Id#", organizationId = "#=OrganizationId#", subcontractorId = "#=SubcontractorId#" }))
.Update(update => update.Action("GridAction_UpdateLineItem", "Contract"))
.Destroy(destroy => destroy.Action("GridAction_DeleteLineItem", "Contract"))
.Create(create => create.Action("GridAction_CreateLineItem", "Contract"))
)
.Events(events => events.Save("gridLineItem_OnSave"))
.ToClientTemplate()
)
</
script
>