Hello:
I have a Master/Child grid structure like so:
Parent Grid:
Child Grid as DetailTemplate:
The Problem:
I have a #if{# ... #}# statement in the column ClientTemplate, however the Rating value is from the Parent Grid not the current Child Grid (Parent Grid happen has a column also named 'Rating'), to prove that it is from Parent Grid, if I change Rating to a column that only exists in the Child grid, i.e. SubEleID, it gives error at browser, saying that SubEleID is not found.
The Question:
so what is the syntax for Rating gets the Child Grid value?
just for the sake of trying, I even tried: data.Rating, or $(this).Rating, none worked.
Please advise,
Thank you
I have a Master/Child grid structure like so:
Parent Grid:
@(Html.Kendo().Grid<ElementViewModel>().Name("gridEle").Columns(cols =>{ cols.Bound(e => e.EleNum)}).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetElements", "Rating", pi)) ).ClientDetailTemplateId("tempSubEle") )Child Grid as DetailTemplate:
<script id="tempSubEle" type="text/kendo-tmpl">@(Html.Kendo().Grid<SubElementViewModel>().Name("gridSubEle_#=EleID#").Columns(cols =>{ cols.Bound(e => e.Rating) .ClientTemplate("<input type='checkbox' value='1' " + "#if(Rating==1){#checked='checked'#}# />" );}).DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("GetSubElementsByElementID", "Rating", new { eID = "#= EleID #" }))).ToClientTemplate()) </script>I have a #if{# ... #}# statement in the column ClientTemplate, however the Rating value is from the Parent Grid not the current Child Grid (Parent Grid happen has a column also named 'Rating'), to prove that it is from Parent Grid, if I change Rating to a column that only exists in the Child grid, i.e. SubEleID, it gives error at browser, saying that SubEleID is not found.
The Question:
so what is the syntax for Rating gets the Child Grid value?
just for the sake of trying, I even tried: data.Rating, or $(this).Rating, none worked.
Please advise,
Thank you