Home > database >  The original concept to create infinite depth of TreeView tree
The original concept to create infinite depth of TreeView tree

Time:09-17

Great god give with advice on how to create an infinite depth in the original concept of the tree!

CodePudding user response:

The
refer to the original poster juneyjiang response:
great god give with advice on how to create in the original concept of infinite depth tree!


This is related to the data, the tree is infinite depth

CodePudding user response:

Under the moderators can help yao, I there is data, what can I do level 3, I want to make it similar to the resource manager that tree (treeview), each of the nodes on the number of child nodes, or moderators can give routines?

CodePudding user response:

refer to the second floor juneyjiang response:
under the moderators can help yao, I there is data, what can I do level 3, I want to make it similar to the resource manager that tree (treeview), each of the nodes on the number of child nodes, or moderators can give routines?


This mainly related to your data, you can consult pb's own example, there is a file manager to make the tree of the operating system example

CodePudding user response:

The data structure:
ID node ID
The name node name
Level level
SuperID parent node ID
If there is a lower leaf_flag

The function
F (level, id)
Starting from level=0, remove all SUPERID id is set,
Circulation inserted into a tree, a leaf_flag inserted a judgment, if there is a lower, call f (level, id), parameters of the current level and id,
At a lower level to circulation,

Level and can realize unlimited, but the reality is more than 3 level traversal will be very slow, you can baidu recursion, no development environment, otherwise can give you post code,

CodePudding user response:

Table structure, such as:
ID int identity not null - the node ID, int, since the column (column was built only clustered index)
ParentID int the not null - the parent node ID, int, is not empty, used to specify that this node's parent (s) the first layer node (built this column is not the only non clustered index)
FullName nvarchar (32) - node name.

CodePudding user response:

Pb base class object (pb6 source) are an example of a treeView based on parent-child column:
http://download.csdn.net/detail/msgtogcr/974023
  • Related