Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Recursive parent-child relations

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
william_wicker



Joined: 24 Mar 2006
Posts: 1
Location: Austin, TX

PostPosted: Fri Mar 24, 2006 10:40 pm    Post subject: Recursive parent-child relations Reply with quote

I am evaluating VirtualTree for one of my projects. I have a need for a recursive parent-child relationship (in my case, for a parts-list).

A simple example is:
Item 1
+- Item 2
+- Item 3
+- Item 3a
+- Item 3b

The data table for this might be
ItemID, Parent ID
Item1, (null)
Item2, Item1
Item3, Item1
Item3a, Item3
Item3b, Item3

The point here is that the nesting can be arbitrarily deep.

The recursive relation I just described is the classic case.

My specific case is more complex. For reasons beyond my control, I have three tables which recurse alternately. For example:

MasterA
+- Operation1
+- Component-a
+- Component-b
+- Operation2
+- Component-c
+- Component-d/MasterB
+- Operation3
+-Component-e

The basic patterns are:
- Masters have child operations
- Operations have child components
- Components can be Masters, have operations, and the recursion continues...

How should I approach this?
_________________
William Wicker
ARM Automation
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Mar 25, 2006 6:27 am    Post subject: Reply with quote

Are you binding to ADO.NET data or is the data coming from some other data source? In either case binding to arbitrarily deep data is not a problem.

If you are binding to ADO.NET data take a look at the following thread for some hints:

http://www.infralution.com/phpBB2/viewtopic.php?t=233&highlight=single+table

If you are using Object or Programmatic binding it is also straightforward. For Object binding create bindings for each type of item (Masters, Operations and Components) and set the ChildProperty for the binding to the property of the item that returns the list of children. For programmatic binding simply handle the GetChildren event and return the children based on the row item.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group