This question is locked. New answers and comments are not allowed.
Hi I am using Telerik tree view with Ajax binding. I have a category tree where each category can have one or more categories and so on.
When I want to add custom html content to the tree view item, by using the Content property, expand/collapse buttons disappear. Also content I am setting is not displayed. When I look at the generated HTML, I can found that span with class 't-plus' and span with class 't-content' have style property set to 'display:none'.
Everything is working as expected when I remove following code:
Here is the code that I am using in my view and that is working as expected:
Could you please take a look into this problem?
When I want to add custom html content to the tree view item, by using the Content property, expand/collapse buttons disappear. Also content I am setting is not displayed. When I look at the generated HTML, I can found that span with class 't-plus' and span with class 't-content' have style property set to 'display:none'.
Everything is working as expected when I remove following code:
item.Content = (() => {%> add template <% });Here is the code that I am using in my view and that is working as expected:
<% Html.Telerik().TreeView().Name("TreeView").ShowCheckBox(true).DragAndDrop( settings => settings.Enabled(true)).BindTo( Model.RootCategories, mappings => { mappings.For<CategoryViewModel>( binding => binding.ItemDataBound( (item, category) => { // bind initial data - can be omitted if there is none item.Text = category.Title + "<span>bla</span>"; item.Value = category.CategoryID.ToString(); item.LoadOnDemand = category.HasChildren; item.Encoded = false; if (checkedNodes != null) { var checkedNode = checkedNodes.Where( e => e.Value.Equals(category.CategoryID.ToString())). FirstOrDefault(); item.Checked = checkedNode != null ? checkedNode.Checked : false; } })); }).DataBinding( dataBinding => dataBinding.Ajax().Select("_AjaxLoading", "Category")) .ClientEvents( events => events.OnNodeDrop("onNodeDrop").OnNodeDropped("onNodeDropped").OnSelect("onSelect"). OnChecked("onChecked")).HtmlAttributes(new { @class = "t-group" }).Render();%>Could you please take a look into this problem?