I retrieved a DataSet from the database with multiple tables, and defined the relationships between the tables. When I bind the DataSet to the Tree, the relations show-up as nodes in the Tree hierarchy. How can I hide these relations.
For example, instead of:
Tom Harden
InvoiceRelationshipName
1 $500
2 $450
I would like:
You can't skip a level of the data hierarchy, so unless there is a DataRelation defined between the data in the which the invoice records reside and the one in which the names of people reside (e.g., "Tom Harden"), you can't. You should be able to use a SQL query to create a DataSet with one table that has the people's names and another with the invoice records, and define a relation between them, in effect skipping the "InvoiceRelationshipName" in the example given above.
Note that the UltraTree.ColumnSettings.ShowBandNodes property allows you to hide the label nodes that are created for "bands", but I don't think that will help you here.
I'm not trying to skip a level in the data hierarchy. I have two tables in the example: Customer and Invoice, and I've created a DataRelation between the two tables: InvoiceRelationshipName. I'd like to hide the band created by this relationship.
The ShowBandNodes property only has two options: OnlyForSiblingBands and Always. Neither seems to hide the relationship bands.
Yes, That's my situation. I have two relationships. I'll use your approach, or modify my SQL to avoid more than one relationship.
Hi,
The band nodes should not be displayed unless you set ShowBandNodes to Always, or unless there is more than one relationship under the Customer table which creates a situation where there are sibling bands.
Is there more than one relationship? If so, you can get around this by removing the second relationship from the tree. The way it works is that a child band is basically a special type of column in the parent band. Assuming you are allowing the tree to automatically generate the column sets for you, you can handle the ColumnSetGenerated event of the tree and trap for the ColumnSet whose Key is "Customer". Then you can remove the column that represents the other relationship(s) - the one(s) other than InvoiceRelationshipName.