This question is locked. New answers and comments are not allowed.
My grid :
works fine to this point.
Now, because I want to display a slightly different view when a record is expanded, based on the type I'm trying to inject the detailview.
when I add the following to the above code:
I cannot use @item here, but it's ok above in the columns. HOw then can I obtain the current items sectionID etc to inject into my <div> tag. If I can do this then my problem is solved.
@(Html.Telerik().Grid(Model.Sections) .Name("policyZoneGrid") .DataKeys(keys => keys.Add(r => r.SectionID)) .Groupable(grouping => grouping.Groups(groups => { groups.Add(r => r.UIDisplayName); })) .ToolBar(toolbar => toolbar.Template(@<text> <button id="addSection" type="submit">Add Section</button><span> </span> @Html.DropDownListFor(x => x.SectionTypeSelectedId, new SelectList(Model.SectionTypes, "Value", "Text")) </text>)) .Columns(columns => { columns.Template( @<text> @Html.ActionLink("Edit", "Edit", @item.ControllerName, new { sectionID = @item.SectionID, policyZoneID = Model.PolicyZoneID }, null) <a class='deleteSection' href='#' sectionid=@item.SectionID url=@item.ControllerName >Delete</a> </text>).Width(40).Title("Commands"); columns.Bound(r => r.Name).Title("Name").Width(200); columns.Bound(r => r.UIDisplayName).Title("Section").Width(200); columns.Bound(r => r.Gross).Title("Gross").Width(150).Format("{0:0.00}").HtmlAttributes(new { style = "text-align:right" }); }) .Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add(o => o.UIOrder).Descending())) .Pageable() .RowAction(row => { if (row.IsAlternate) { row.HtmlAttributes["style"] = "background:aliceblue;"; } })Now, because I want to display a slightly different view when a record is expanded, based on the type I'm trying to inject the detailview.
when I add the following to the above code:
.DetailView(detailview => detailview.ClientTemplate("<div id='section_'" + @item. + ">Loading risk summary data<img src='/Content/bar-circle.gif' /></div>")) .ClientEvents(events => events.OnDetailViewExpand("displaySectionDataByType"))