添加中的动态树视图 [英] Dynamic Tree view in Adding

查看:84
本文介绍了添加中的动态树视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
请帮帮我.
我正在使用Asp.net,C#和Linq创建动态树,所以我在添加选择节点的节点时如何添加问题?

Hello
Please help me.
I am Creating a dynamic tree using Asp.net,C# with Linq so i have problem to add the node of selecting node how adding?

推荐答案

基本上,您必须填充父级,然后实现OnTreeNodePopulate事件.您可以将标记创建为:

Basically you have to populate the parent level and then implement the OnTreeNodePopulate event. You might create the mark-up as:

<asp:TreeView

    ID="tvRPM"

    runat="server"

    ClientIDMode="Static"

    EnableClientScript="true"

    ExpandDepth="0"

    PopulateNodesFromClient="true"

    ShowLines="true"

    OnTreeNodePopulate="PopulateNode"

    OnSelectedNodeChanged="tvRPM_SelectedNodeChanged">
    <NodeStyle ForeColor="Black" HorizontalPadding="3" VerticalPadding="3" />
    <HoverNodeStyle BackColor="#ffffcc" />
    <SelectedNodeStyle BackColor="#dddddd" BorderColor="DarkGray" BorderStyle="Dotted" BorderWidth="1" HorizontalPadding="5" VerticalPadding="3" />
</asp:TreeView>



并有一种方法可以在加载时填充父母.然后,在PopulateNode方法中,您将创建并填充将父级的唯一ID作为键的子节点.

PopulateNode的方法签名如下:



and have a method that populates the parents on load. then , within the PopulateNode method you would create and populate the childnodes passing the unique id of the parent as a key.

The method signature of PopulateNode looks like:

protected void PopulateNode(Object sender, TreeNodeEventArgs e)



我留给您研究从这一点开始填充每个新节点的方法.请注意,有几篇有关CP的文章详细概述了此过程:首先搜索这些文章.



I leave it to you to research the means by which you populate each new node from this point. Note that there are several articles on CP that outline this process in detail: search for those first.


这篇关于添加中的动态树视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆