The following code does not render my TreeView child nodes as expected. (Sorry,cannot figure out how to format code snippet).
Html.Telerik().TreeView()
.Name(
"TreeView")
.BindTo(Model
as IEnumerable, (mappings) =>
{
mappings.For<
ArticleSummary>(binding => binding
.ItemDataBound((item, category) =>
{
item.Text = category.Abstract;
})
.Children(category => category.Children));
mappings.For<
ArticleSummary>(binding => binding
.ItemDataBound((item, article) =>
{
item.Content = () =>
{
%>
<div class="img-box3">
<%
if (article.ContainsValidThumbNail())
{ %>
<img src='<%=Url.Action("GetImageForArticleId", "Resources", new { id = article.Id })%>' alt=""/>
<%}%>
<%
=article.Abstract%>
<%
if (article.ContainsMainText)
{ %>
<a> <%= Html.ActionLink("Details", "Details", "News", new { newsId = article.Id }, null)%></a>
<% } %>
</div>
<%
};
}));
}).Render();
%>
All I see it articl.Abstract rendered for each node. I do not see the image and ActionLink. Please note that all code within item.Content() works well outside of the tree view. Is this the proper way of creating each node using a cssClass?
TIA.