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 

Siblings do not appear in tree

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



Joined: 10 Sep 2006
Posts: 5
Location: Portland, Oregon, US

PostPosted: Sun Sep 10, 2006 4:10 am    Post subject: Siblings do not appear in tree Reply with quote

Hello, I am evaluating Virtual Tree and have worked out most of my questions; however, all the data is not appearing in the tree.

Here is the schema:

OrderDate
OrderNumber (Order header with the OrderDate)
OrderItems (regular items without options)
ItemList (each item listed with serial number)
OrderKitItems (items with options)
KitItemList (each kit item listed with serial number)
KitItemOptions (list of add-ons for the kit item)
KitItemOptionList (each option listed with s/n)

Example:
Order 10222 Dated 7/31/06 has 2 lines:
1. Item A12 (regular Item) QTY 3
2. Item K14 (kit item) QTY 2

The kit item has 2 optional add-ons:
1. Item K14a (QTY 2 per kit)
2. Item K14b (QTY 1 per kit)

The tree should look like this:

7/31/06
10222 Joe Customer 123 Main St. etc.
A12 Hard Drive
SN 23222
SN 23224
SN 23225
K14 Dual Core Pentium Computer
SN 4323456-A
K14A 512Mb RAM
SN 1002
SN 1004
K14B DVD Burner
SN 323232



I have checked the schema and previewed the data and it is all there, but the tree only shows the first 4 nodes - neither the kit item node or any of its child nodes show up.

I hope this is something I am doing wrong, and not a limitation of the control, since I like many of its other features.

Also, how can you display a label on the tree on each data row group to tell people what each node represents?
Thanks
Steve
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Sep 11, 2006 12:10 am    Post subject: Reply with quote

I think your tree example may have lost it's formatting when you posted it. You didn't say whether you are using DataSet binding or Object binding?

There are two possible reasons why items don't show up. One is that there was no RowBinding for the item (or at least Virtual Tree couldn't match the item to any RowBinding you defined). This means that Virtual Tree doesn't know how to display the children of the item. The other possibility is that the ChildRelation (for DataSet binding) or ChildProperty (for object binding) is incorrectly defined.

If you still can't figure it out you can email a sample project to support@infralution.com and we will be happy to take a look.

Quote:
Also, how can you display a label on the tree on each data row group to tell people what each node represents?


I'm not quite sure what you want here - can you give a bit more of a description.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Steve Jensen



Joined: 10 Sep 2006
Posts: 5
Location: Portland, Oregon, US

PostPosted: Mon Sep 11, 2006 5:51 am    Post subject: Reply with quote

Yes, it looks like it lost the tabs to indent the picture Embarassed

The binding is DataRows. What does object binding do?

Again, there is a top-level query that just contains the dates in which there are orders, then the next level, which is the orders that are on the dates in the top-level query. So far so good.

The lext level down is the order lines. They are of 2 types, so there is a query for each type. Each type needs it's own node. Call the types 'systems' and 'other'. All the lines that are systems need to be grouped under the systems node, and the others under the 'other' node.

For the 'others', that is the extent of it. For the systems, there is another level yet, for system components.

In the source table, all three records are in the same table, with codes to define each one. Say systems are code 1, non-systems (other) are code 2, and system components are code 3.

The tree needs to display the dates (which it does), the orders under those dates (it does that, too), then nodes under each order for order lines of codes 1 and 2, and yet another node under code 1 order lines for the code 3 lines (the subassembly items or components of the systems).

So it is:

Date
----->Order 1002
-------------->Systems
--------------------> System 1
--------------------> System 2
------------------------------->Components
------------------------------------> Subsystem 21
------------------------------------> Subsystem 2
--------------------> System 3
------------------------------>Components
------------------------------------> Subsystem 1
------------------------------------> Subsystem 2
---------------->Other
---------------------> Monitor
---------------------> Ext. 250Gb USB Drive
------>Order 1003
etc


If I remove the 'other' DataRow I can get the systems to display, although there is no data in the colums. I can't seem to get them both going though.

Also, I am getting this error, and the child record columns are blank:

Parameter name: name
VirtualTree: Error while getting field () of table (PRDSystemSubassemblies).
Error: 'name' argument cannot be null.

The illustration above shows what I was asking about with the labels - a node label for each level to collapse or expand everything below it.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Sep 12, 2006 12:05 am    Post subject: Reply with quote

So your data is coming from an ADO.NET DataSet? Object binding lets you bind to data from any .NET object/list.

It's difficult to diagnose this without any code. My guess is that the problem is the mismatch between your actual DataSet tables/relationships and the way you wish to display it. DataSet binding works really well when your display hierarchy is directly reflected in the DataSet relationships (see the DataSet Browser sample for example).

If however you wish to group/order your display differently then you have to do some more work. There are two ways you can do this. One is to use some programmatic binding to handle the mapping differently to the default DataSet binding. The second options is to actually build an object layer which reflects the display structure you want and load the data into this object layer - which can then be displayed in Virtual Tree using Object Binding (see the SimpleTree sample)

VirtualTree selects the RowBinding that matches a given DataRow - you can't by default have two DataRowRowBindings defined for the same table - VirtualTree will just use the first one that matches. This is what suspect is happening. The error you received also indicates something is screwed up in your RowBinding definitions - it looks like the CellBinding(s) for the Row aren't defined to map the DataRow column to display in a given VirtualTree column. Again this would be much easier with some code. If you can't zip your entire project and email it to us, it would help at least to post the designer generated code - so that we can look at your RowBinding definitions.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Steve Jensen



Joined: 10 Sep 2006
Posts: 5
Location: Portland, Oregon, US

PostPosted: Tue Sep 12, 2006 12:26 am    Post subject: Reply with quote

Are you saying the control cannot display hierarchical data? I do not understand.

As a simple example, suppose you want to show a tree that shows the classes that are conducted in a classroom, as well as the equipment in the classroom. Both the Classes table and the Equipment table relate to the Classroom, and both would logically show as child nodes under the classroom. Since neither classes or equipment are related to each other directly, they would be siblings on the tree:

Classrooms
---->Classes
---->Equipment

The data set shows the classes related to the classroom by the room number, and the equipment also.

If the control does not do this, then I am totally lost as to what a tree view control is used for.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Sep 13, 2006 1:09 am    Post subject: Reply with quote

You can display any type of hierarchical data using Virtual Tree - however when binding to a Dataset it is much more straightforward if the children of a given node/row type can be obtained through a DataSet child relation. In the case you give below you actually have two different types of children (Classes and Equipment) and presumably you want to group the class objects under the classes header and the equipment items under the equipment. This structure is probably not reflected in your actual DataSet design ie you don't have a relationship which for each classroom will return the children for that row (ie Classes Group and and Equipment Group) and then relationships for these objects that return the items under them.

Because your display structure is significantly different to your actual data structure you may be better off creating an object layer that represents your display structure and then using Object Data Binding to display this.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Steve Jensen



Joined: 10 Sep 2006
Posts: 5
Location: Portland, Oregon, US

PostPosted: Wed Sep 13, 2006 4:15 am    Post subject: Reply with quote

Actually, the schema does reflect the structure where there are two children of the same parent. You are correct in what I want to acheive but incorrect in assuming the underlying data does not reflect it. I have tried a number of other databound tree/grid controls that seem to have no problem rendering the data. I have sent an email to your support email address with a screen shot of the data rendered (correctly) by another control.

I did also try using object binding and got no results at all, so perhaps it would be most productive if you would just give me a step-by-step for creating object binding on ADO.NET dataset members to accomplish this objective.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Sep 13, 2006 11:34 pm    Post subject: Reply with quote

We really need some code to be able to resolve this issue. It is very difficult to give you good advice without being able to see your database schema and the data binding code you are trying to use.
_________________
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