水平树视图ASP.NET [英] Horizontal Tree view ASP.NET

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

问题描述

UserID parentID位置
1 0 0
2 1 0
3 1 1
4 3 0
5 3 1



这里的位置可以是0或1 ..e.e左为0,右为1

现在的场景是:

在当前页面上,假设我在一个字符串变量中有一个用户的userID,可以说1,所以我想做的是我需要为该特定的userID创建一个树.
我认为我们可以实现的方式是-

首先,我们将在该数据库中找到所有具有parentID作为该userId(在这种情况下为"1")的条目,因此我们将获得属于该userID的子节点的列表
然后将其递归运行,以便为每个孩子找到树(有孩子的树,依此类推)

一旦建立了该userID(在临时数据库中)上的树,我就需要以图形形式显示它.

对于上面的数据,它应该生成
http://tinypic.com/r/30bedxk/7

UserID parentID Position
1 0 0
2 1 0
3 1 1
4 3 0
5 3 1



here position can be 0 or 1 ..i.e 0 for left and 1 for right

Now the scenario is:

on current page lets assume i have a userID of a user in a string variable lets say 1 so what i am trying to do is i need to create a tree for that particular userID.
the way i am thinking we could achieve is -

first we will find out in that database all entries who have parentID as this userId( ''1'' in this case) so we will get list of nodes which are child to this userID
then will run this in recursion so that for each of that child will find out the tree ( there child''s and so on)

once this tree on that userID( in a temporary database) is build i need to show this in graphical form...

for above data it should generate
http://tinypic.com/r/30bedxk/7

推荐答案

请检查以下链接.第一次我也使用那里的概念.

http://stackoverflow.com/questions/2572721/recursive-treeview-in-asp-ne [ ^ ]
Please check the below link. At the first time I also use the concept from there.

http://stackoverflow.com/questions/2572721/recursive-treeview-in-asp-ne[^]


到目前为止,您尝试了什么?如果您在此处发布一些代码,也许有人可以为您提供更好的帮助.
What have you tried so far? If you post some code here someone maybe able to help you better.


这篇关于水平树视图ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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