Hi,
I have a hierarchical grid with where the child is displaying data from the parent, I suspect its the way Im binding to the data.
Parent
Child
Both grids use the ElementSeqNo field to create a Hyperlink, however as stated, the child is taking the parent element data.
Any suggestions appreciated.
Regards
Ross
I have a hierarchical grid with where the child is displaying data from the parent, I suspect its the way Im binding to the data.
Parent
@(Html.Kendo().Grid(Model.CVXElements) // Specify the type of the grid
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ElementSeqNo).Title("Element ID").Width("100px").ClientTemplate(
Html.ActionLink("#= ElementSeqNo #", "PUSH", "ElementBuilder", new {url = "~/PagCC/EB_ElementAddEdit.aspx", ID = "#= ElementSeqNo #", cvxCode = Model.CVXCode }, null).ToString());
columns.Bound(p => p.ElementName).Width("900px");
columns.Bound(p => p.ElementStatus).Width("100px");
columns.Bound(p => p.ElementActive).Title("Live").Width("100px");
columns.Bound(p => p.ParentElement).HtmlAttributes( new {@style= "display:none"}).HeaderHtmlAttributes(new { @style= "display:none;" });
})
.ClientDetailTemplateId("ParentElementTemplate")
.Events(events => events.DataBound("dataBound"))
.DataSource(dataSource => dataSource
.Ajax()
)
.Events(events => events.DataBound("dataBound"))
<
script
id
=
"ParentElementTemplate"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<
ElementBuilder.Models.Elements
>(Model.CVXElementParents)
.Name("ParentGrid")
.Columns(columns =>
{
columns.Bound(p => p.ElementSeqNo).Title("Element ID").Width("91px")
.ClientTemplate(
Html.ActionLink("#= ElementSeqNo #", "PUSH", "ElementBuilder", new {url = "~/PagCC/EB_ElementAddEdit.aspx", ID = "#= ElementSeqNo #" }, null).ToString());
columns.Bound(p => p.ElementName).Width("910px");
columns.Bound(p => p.ElementStatus).Width("100px");
columns.Bound(p => p.ElementActive).Title("Live").Width("88px");
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("HierarchyBinding_ParentElements", "ElementBuilder", new { iElemSeqNo = "#=ElementSeqNo#" }))
)
.ToClientTemplate()
)
</
script
>
Any suggestions appreciated.
Regards
Ross