We would like to display nodes with to separated values (name, description) in a ultratree,
where for example the second value is readonly or can be modified independently from the first and vice versa:
root
|
-- name description
-- name1 description1
-- name2 description2
_tree.ColumnSettings.ColumnSets
but the tree not yet displays anthing.
Do you have a simple code snippet that shows how to fill the having to values per node
without binding a hole dataset to the tree, but adds the nodes recursively node by node
Thanks
Kagel
Hello Kagel,
I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.
Thank you for using Infragistics Components.
Hi Kagan,
Thank you for the reply.
1) If you have the same structure for all your node levels you can use the override of the tree to set the ColumnSet:
ultraTree1.Override.ColumnSet = new UltraTreeColumnSet();
2) If you need to assign icon, you can use the Appearance properties of the cells or the CellAppearance property of the Override (assign an image to the appearance objects):
// Use the same icon for each cell
ultraTree1.Override.ColumnSet.CellAppearance = infraImageAppearance;
// If you want to set an icon for a specific cell use this instead
ultraTree1.Nodes[0].Cells[0].Appearance = yesImageAppearance;
3) To hide the headers you can use the LabelPosition property:
ultraTree1.Override.ColumnSet.LabelPosition = NodeLayoutLabelPosition.None;
To allow editing use the CellClickAction and the AllowCellEditing properties:
ultraTree1.Override.ColumnSet.AllowCellEdit = AllowCellEdit.Full;
ultraTree1.Override.CellClickAction = CellClickAction.EditCellSelectText;
I have modified my sample in order to demonstrate this suggestions.
Let me know if you have any additional questions.
Hi Dimitar,
works fine. Thanks regarding this Topic I have some additional questions
1 do we have a more elegant way to assign a ColumnSet to any nod Level in a tree, instead of doing it for each level
instead of
ultraTree1.NodeLevelOverrides[0].ColumnSet = cs;
ultraTree1.NodeLevelOverrides[1].ColumnSet = cs;
ultraTree1.NodeLevelOverrides[2].ColumnSet = cs;
but a Kind of
ultraTree1.ColumnSet = cs; ??
the tree Content is dynamic and can be nested very deep >15level ? and the columnsets are the same for each level
2. we would have to assign a Icon to each node, can we do this the Grid ViewStyle ?
3 the grid Header
"Name"/"Description" should be hidden, and the cell editable how can we do this
If we solve that we get a very useful snippet, Thanks in advance
Hi Kagel,
Thank you for posting in our forums.
What you could do in your case is to use the NodeLevelOverrides, property of the tree. With this property you can set the column set with the desired properties. For more information please visit this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/Infragistics4.Win.UltraWinTree.v12.2~Infragistics.Win.UltraWinTree.UltraTree~NodeLevelOverrides.html
I have attached a sample demonstrating this approach.
Please let me know if you have any additional questions.