Hi There,
I would like to have a tree, every node with multiple columns, and cells can have editors (combobox, checkbox, etc).Checking your WinTree Samples, I cannot see how to do this: all muticolumn example is over a DB table. The property pane sample looks almost ok, except that there not all node has value.
I am attaching a screenshot, what I would like to have with Infragistics Tree.Please let me know if it's possible, if not, how to have this.Note that I don't have any database underneath, I would like to fill the tree manually, just addig nodes, which are generated on the fly as a parent node is expanded.
*Edit*I found one of your samples (Multi-Column and Data Binding (Recursive)) similar what I need, if I choose Outlook view.See:
Looks this is the way I have to try? I know it uses datasource underneath...but I can live with it if no other way. Note that my structure could contain infinite recursion (it will add a new level always when user clicks on [+]). Can it be done?
You do not have to bind the tree to have multiple columns. Binding the tree is a very easy way of getting columns, but you can define them yourself.
The easiest way to do this is to set the tree's Viewstyle to OutlookExpress mode - that's the mode most similar to the screen shots you have here. Then you have to create a ColumnSet and assign it to the RootColumnSet of the tree. If there are no samples of this, it's probably because it's much easier to do it in the form designer than in code.
What you do is go to the property grid in Visual Studio for the tree and look at the tree.ColumnSettings.ColumnSets property. There's an ellipsis button here and clicking it will allow you to add a new ColumnSet to the collection.
Use the Columns property of your new ColumnSet to add the columns you want and set the DataType and any other properties you want on each one.
When you are done, click OK and go to the tree.ColmunSettings.RootColumnSet property and select the columnset you created from the list. Not that there's a bug in Visual Studio (at least in VS2008) where lists that only contain one item don't display very well. So if you drop down the list and don't see anything on it, just push the down arrow on your keyboard and press Enter.Or add more than one ColumnSet to the collection.
At this point the columns will show up in the tree.
You can add nodes to the tree using the tree.Nodes.Add method and then use the Cells collection on the node to populate the values of each column.
Thanks Mike,
Now I have the tree, and I add a node, but all Cells are empty, and I cannot set a text to them, as node.Cell.Text is a read-only property. Also the Cell.Value.The Node.Text has a value, but it's not visible in Outlook mode.How to put text into the cells?
The Text property of the cell is read-only, but you can set the Value.
UltraTreeNode node = this.ultraTree1.Nodes.Add(); node.Cells[0].Value = "Node 0, cell 0"; node.Cells[1].Value = "Node 0, cell 1"; node.Cells[2].Value = "Node 0, cell 2";
Ah, indeed, so simple, but was confused by help, which says:Value Returns the value for this UltraTreeNodeCell.
I thought this is also read-only, did not check the code.A suggestion: change the help to Gets/sets (or whatever) which indicates this.
Thank you all the help Mike!
Ah, sorry about that. The Value property used to be read-only, but it was made writable a long time ago. So I guess that was missed when the documentation was updated. I will forward this along to the docs people so they can get it corrected.