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 

Trees and Dataset

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



Joined: 08 Dec 2005
Posts: 15

PostPosted: Sun Dec 11, 2005 5:58 pm    Post subject: Trees and Dataset Reply with quote

A typical way to represent a tree in a DataSet is to have a Table with for example the following columns;

Id (PK)
ParentId (FK)
Name

and a relation connecting the FK with the PK.

Code:

dataset.Tables["Items"].Rows.Add(new object[] { 1, null, "One" });
dataset.Tables["Items"].Rows.Add(new object[] { 2, 1, "Two" });
dataset.Tables["Items"].Rows.Add(new object[] { 3, 1, "Three" });
dataset.Tables["Items"].Rows.Add(new object[] { 4, 2, "Four" });


This would represent the tree
Code:

One-+-Two-Four
    |
    +-Three


Now using VirtualTree and data binding works kind of. If you point VirtualTree to the dataset and point it to the table it will use the relationship defined for both parent and child relationship. It will then display the tree I expect but also every possible subtree which is not what I want.

Does any one have a soloution to this problem or is the answer as I suspect, don't use data binding do it the hard way i.e. I have to populate the tree myself.
_________________
Kind regards

Magnus Werner, System Architect
------------------------------------------
Saab Training Systems AB
Back to top
View user's profile Send private message
mwe



Joined: 08 Dec 2005
Posts: 15

PostPosted: Sun Dec 11, 2005 6:01 pm    Post subject: Question already answered Reply with quote

I see that the question is already answered in "Single table NodeID ParentNodeID". I'll try it out.

Thanks!
_________________
Kind regards

Magnus Werner, System Architect
------------------------------------------
Saab Training Systems AB
Back to top
View user's profile Send private message
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