Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
600
A simple tree with columns
posted

Dear all,

perhaps I am being stupid but it seems rather difficult to display a simple UltraTree with some columns set to checkboxes. As an aside I find the Infragistics documentation very poor on all sorts of things, to the point I now no longer use it and try google instead.

But back to my main point, as a first step I tried getting an UltraTree with columns. I've tried all the advice of different dispaly styles, etc. with no luck. I've attached a simple project showing my point. I've created a form with an UltraTree which has 3 columns at design time, one should be a string with the other two booleans (for the check boxes). This is then populated with nodes but I can not get the columns to appear. 

There is no binding to a datasource as I intend to extend this once I have the basics working, and for instance the parent nodes will have check boxes which set all the child nodes, but really in the datasource only the child nodes exist (so, as I understand it, binding wouldn't work).

I do not want grids within nodes, like the examples show, besides for me personally thinking it looks ugly and information overload, I do not require it as all the nodes will have the same columns so I only need one set of headers at the very top.

Where am I going wrong?

Regards,

UltraTreeWithCheckBoxColumns.zip
Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    The tree is a bit more complex than some other controls because the ColumnSets are abstracted from the nodes. This allows you to assign different columns to each level, or even to each individual node, but it makes doing simple things a little bit tougher.

    You appear to have created three ColumnSets at design-time in your tree, but there are two problems here, I think.

    First, judging by the names you used, the fact that there are three of them, and the fact that none of your ColumnSets have any columns in them I think you are expecting a ColumnSet to be a Column. A ColumnSet is a set of columns, so you only need a single ColumnSet here with 3 columns in it.

    The other problem is that you haven't hooked up any of the ColumnSets to any nodes.

    Another issue, unrelated to ColumnSets is that the code in your sample is adding nodes with duplicate keys. Keys in the tree have to be unique across the entire tree, not just in the same collection. You are adding in the parent node's text, but your parent nodes have no text in this case because you never assigned any.

    I have modified your sample with an UltraCheckEditor, and I fixed the duplicate key issue by using the Key of the parent node instead of the Text. And I wrote code to set up and apply the ColumnSet correctly. Note that you could get your nodes to return Text if you assign a value to the first string column in the node (the Name cell) and then you could use Text instead of Key.

    UltraTreeWithCheckBoxColumns.zip
Children