Hi!
I have the following problem: I want to bind my UltraTree to a dataset. Within this dataset, there are some tables: departments, positions, employees etc. Each table is connected to an other one with relations set in the data set. For example, the department table has an id column. The positions table has a departmentId column, so that I can connect these tables over these ids.
That works fine for near all relations in the dataset. But as you can see in the screenshot below, I have some empty nodes. For example under the node "Back of House", all positions should appear. But there is an empty node, which contains the positions. I do not want these empty nodes.
It works fine for the employees (e.g. "S., Kai") and the connected salary components. I do the same for all tables in the dataset (connect the tables with relations between the tables using id columns).
Please, can you tell me, whats going wrong?
Thanks a lot for your help! I need it very fast! :)
Best regards!
Robin
Hi,
My guess is that these empty nodes are probably band nodes. If your root band here has multiple child bands, then the tree has to separate them using band nodes so that the same nodes collection doesn't contain data from two different tables in your data set.
If your root band has two child bands, and you only want to display one of them, then you can handle this very easily by hiding or removing the other child band from the tree. The way it works is that a child band is a special type of column in the ColumnSet. So assuming you are allowing the tree to AutoGenerate the ColumnSets, what you would do is handle the ColumnSetGenerated event of the tree and watch for the creation of the ColumnSet for the root band. Then look at the columns in that ColumnSet. There will be two columns which have the IsChaptered property set to true. These represent the child bands and you can hide or remove one of them.
i tried to set the chaptered columns to invisible, but it does not work. All following sub nodes are invisible, too. If these empty nodes are band nodes, there should be the name of the band, or not? Then, if I am clicking onto such an empty node, I got an error which I cannot catch in an exception handler. Please see the screenshot of the error:
Please let me show you my data set and the relations between the tables. Maybe you can find the error: Would be great! :)
Thanks a lot for your help!
Hi Robin,
I'm afraid I do not understand what you mean.
RobinSed said:i tried to set the chaptered columns to invisible, but it does not work. All following sub nodes are invisible, too.
Yes, if you hide the parent node, all it's child nodes are hidden, too. But band nodes only show up by default when you have sibling bands. So if you have a parent-child relationship in your data and you only need to show one set of child nodes under each parent, then you somehow need to remove or hide the sibling band that you don't want.
Maybe I don't understand what you are trying to do.
RobinSed said:If these empty nodes are band nodes, there should be the name of the band, or not?
Well, the band node would ordinarily display as a standard node with no cells and it would display the name of the Relationship, not the table. But I made the assumption that you must be setting the Style on these nodes or applying a ColmnSet to them that is causing them to display like a grid. I could be wrong. But in that case, I have no idea where they are coming from. The tree displays the data structure you give it. So something in your data is causing these nodes to be created. I guessed that they are band nodes, but without seeing the application, it's only a guess.
RobinSed said:Then, if I am clicking onto such an empty node, I got an error which I cannot catch in an exception handler. Please see the screenshot of the error:
A screen shot is not very useful here, since I can't see the entire call stack. Once again, all I can do is guess. But my guess is that this exception is occurring because your code is attempting the access a cell of the ActiveNode in the tree and the band node does not have any cells.