Hi All,
I need to design a custom tree view control which will enable the user to build a tree where each node in the tree is a grid row, i.e. each node will have a name and then beside it there will be a row with several columns. Does anybody have any suggestions on how I could go about this?
I have already tried using an UltraTree and Grid positioned side by side but I found it a bit awkward to keep each node in line with its corresponding grid row.
Any advice greatly appreciated.
Thanks in advance,
Denis
To enable editing, you have to set the CellClickAction:
this.ultraTree1.Override.CellClickAction = Infragistics.Win.UltraWinTree.CellClickAction.EditCell;
To add a dropdown list to a column, the easiest thing to do is to use the ValueList property on the Column.If you are creating the ColumnSet yourself in code then you would do it there. If you are letting the tree automatically generate your ColumnSets for you, then the ColmunSetGenerated event would be a good place to assign a ValueList to a column.
I've managed to kind of get what I need using DataTables and adding them to a DataSet, I've included the screenshot of what my control looks like so it might give you a better idea of what I am trying to acheive. The only issue I now have is that I can't see how to enable editing of the DataColumns in the DataTables. Is this possible and is it also possible to embed editors such as combo boxes in these columns?
I'm still not sure I follow you. How is this different than using a grid or a tree? If you use an UltraWinGrid and bind it to a data source, then the first column shows some text, just as the tree would. So what is it about the tree that the grid doesn't give you?
There's no way to assign a tree to a grid column if that's what you are asking.
Hi Mike,
I'm aware that a datasource can be bound to a tree but I don't think it will give me what I need. In effect what I need is for the tree itself to be the first column of a grid with each node of the tree being a seperate row. In this way, the rest of the columns in the grid will be aligned for each node.
Hi Denis,
I'm not sure I understand your question. What part of this are you having trouble with? The tree supports multiple columns. So it sounds like you just need to bind the tree to the same datasource you are binding to the grid. Then you can just add an unbound column to show the name - assuming the name isn't already part of the data.