Click here to Skip to main content
11,931,104 members (57,582 online)
Rate this:
Please Sign up or sign in to vote.
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
Posted 1-Nov-10 1:05am
Edited 1-Nov-10 1:29am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Please check the below link. At the first time I also use the concept from there.[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

What have you tried so far? If you post some code here someone maybe able to help you better.
ketan541 1-Nov-10 6:15am
Actually I have not yet started so want help with some tutorial or something ..
If there is any ready ASP.NET control for horizontal tree view then i would like to know about it ..

Any help is appreciated...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web04 | 2.8.151126.1 | Last Updated 28 Dec 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100