简体   繁体   English

MVC3 Telerik Treeview将HTML元素(按钮)添加到每个节点

[英]MVC3 Telerik Treeview Add HTML Elements(Button) to each node

I am using Telerik treeview in MVC3 Razor view to display tree structured information. 我在MVC3 Razor视图中使用Telerik树视图来显示树状结构信息。 I would like to Add a set of Buttons/Links (Edit,Create,Details) to each node in the tree. 我想向树中的每个节点添加一组按钮/链接(编辑,创建,详细信息)。 I tried the following but the actionlink does not get displayed.The model is a List 我尝试了以下操作,但未显示操作链接。模型是一个列表

     @(Html.Telerik().TreeView()
    .Name("my-treeview")
    .BindTo(Model, (currentItem,  tree) =>
    {
        currentItem.Text = tree.Name;
        currentItem.Encoded = false;
        currentItem.Expanded = true;
        currentItem.Value = tree.val;
        currentItem.Enabled = true;
        currentItem.Template.InlineTemplate =
                           @<text>

                                 @Ajax.ActionLink("Test", "Test", new AjaxOptions { UpdateTargetId = "testid" });
                           </text>;
    }

This won't work indeed. 这确实无法正常工作。 Set the Text property to the required HTML value. Text属性设置为所需的HTML值。 And make sure Encoded is set to false . 并确保将Encoded设置为false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM