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 

Tree based on Recursive Access Database table

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



Joined: 01 Feb 2010
Posts: 3
Location: Paris France

PostPosted: Tue Feb 02, 2010 12:59 am    Post subject: Tree based on Recursive Access Database table Reply with quote

Hi,

I have an Access database table containing the following attributes:
-id (primary key, autoincremented)
-name (string to show as fisrt column of tree)
-id_parent (Id of parent)
-others columns to show on the tree

Iwould like to obtain the folowing tree:
+name1 others columns
name1.1 others columns
namr1.2 others columns
+name2 others columns

Infralution Virtual tree view is exactly designed to do that.

My question is on how to set Virtual tree parameters:

1. How do I specify the Access database?
2. How do I specify the Table containing the tree data?
3. How do I specify the primary key of the table (id)?
4. How do I specify the parent attribute (id_parent) of the table?
5. How do I specify the others columns?

Best regards
[/list]
Back to top
View user's profile Send private message Send e-mail
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Feb 02, 2010 9:37 pm    Post subject: Reply with quote

You can download a small sample project from our website that demonstrates how to do recursive trees from:

www.infralution.com/downloads/RecursiveDatabase.zip
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Bernard



Joined: 01 Feb 2010
Posts: 3
Location: Paris France

PostPosted: Tue Feb 02, 2010 10:01 pm    Post subject: Reply with quote

Thank you for your fast answer.

I had already browsed support messages found and tried to test "Recursive database" solution but it did not work:

-When I load the project into Visual Studio 2008, it first transform it (from VS2005 to VS2008 I gess)
-Then it gives me an error saying it can not find some references like "common"javascript:emoticon('Evil or Very Mad')

I am new with VS2008 and therefore not yet able to correct these kind of problems (Next week, I will participate to a 5 days hands on training course on VS2008)javascript:emoticon('Very Happy').

I need step by step guidance, setting the right values among the hundreds of shown properties is not obvious.

Best regards
Bernard Evil or Very Mad Evil or Very Mad Evil or Very Mad [/list]
Back to top
View user's profile Send private message Send e-mail
Bernard



Joined: 01 Feb 2010
Posts: 3
Location: Paris France

PostPosted: Tue Feb 02, 2010 10:03 pm    Post subject: Reply with quote

The 3 emoticons devils at the end were added by mistake.
Back to top
View user's profile Send private message Send e-mail
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Feb 02, 2010 10:59 pm    Post subject: Reply with quote

I think the error you received may be because you only have VB.NET installed and the sample project is C#?

Anyway I have updated the sample project to VS2008 and added a VB.NET version so that you can play with it. You can download it at the same link: www.infralution.com/downloads/RecursiveDatabase.zip

First, if you are unfamiliar with VS2008 and Datasets you should read the Microsoft documentation on these. Then you should probably look at the Virtual Tree documentation on binding to Datasets and the standard DataSet Browser sample project.

Binding to a recursive dataset is similar to binding to a normal dataset, except that normally you bind the root item in the tree to a whole table of the dataset. For a recursive dataset you only want to display DataRows that don't have parent DataRows as root items, then use the relationships to display their children. In the sample project to restrict the root item to the root DataRow in the table we create a DataView and set the RowFilter to "Parent_ID IS NULL". This will select only the data rows which don't have parents. Then we set the VirtualTree.DataSource to this DataView.

In the Virtual Tree RowBindings we have two different bindings. One is the DataView binding (to bind the DataView to the root node of the tree) and the other is DataRow binding which binds the DataRows in the table to nodes in the tree. The ChildRelation and ParentRelation properties of the DataRow binding are set to the recursive relationship (which you must have defined in the Dataset).
_________________
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