View previous topic :: View next topic |
Author |
Message |
Bernard
Joined: 01 Feb 2010 Posts: 3 Location: Paris France
|
Posted: Tue Feb 02, 2010 12:59 am Post subject: Tree based on Recursive Access Database table |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
|
Back to top |
|
|
Bernard
Joined: 01 Feb 2010 Posts: 3 Location: Paris France
|
Posted: Tue Feb 02, 2010 10:01 pm Post subject: |
|
|
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('')
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('').
I need step by step guidance, setting the right values among the hundreds of shown properties is not obvious.
Best regards
Bernard [/list] |
|
Back to top |
|
|
Bernard
Joined: 01 Feb 2010 Posts: 3 Location: Paris France
|
Posted: Tue Feb 02, 2010 10:03 pm Post subject: |
|
|
The 3 emoticons devils at the end were added by mistake. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Feb 02, 2010 10:59 pm Post subject: |
|
|
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 |
|
|
|