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 Binding to a table

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



Joined: 27 Nov 2006
Posts: 3

PostPosted: Wed Dec 06, 2006 6:49 am    Post subject: Recursive Binding to a table Reply with quote

Hello Grant,

can you tell me how i can do a recursive bind to a tbale having parent child relation within the same table.

example

id
name
parentid

id........Name..........parentid
1.........Boss...........1
2.........Jug.............1
3.........Reg.............2

so how can i create structure which displays in the virtual tree as
Boss
--------Jug
-----------Reg


In vb.net if possible please

regards
Anwar
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Dec 06, 2006 10:56 pm    Post subject: Reply with quote

If the table is in a DataSet then you can setup a Relation in the DataSet between the ID and Parent_ID. You can create a DataView and set the RowFilter to "Parent_ID IS NULL" and set the DataView as your DataSource. You bind to this DataView as you would a normal data table in a data set.

I suspect however from our previous correspondence that you don't have a DataSet and are dealing with isolated DataTables. In this case you will need to locate the parent DataRow (ie with Parent_ID NULL) and set this as you data source. Then you will need to handle the GetChildren event and locate the child DataRows for the given eventArgs.Row.Item (which will be a DataRow) put them into a collection (eg an ArrayList) and return them in the eventArgs.Children
_________________
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