Hi everybody, I create on fly nodes on a UltraTree and I need to customize the columns depending on the type of node. If the node is a child node I do not want to show again the header, for example.
I am using this code but it doesn't work as it should because the column size stays small and doesn't resize as it should, but the header is now not visible as I need:
// this method has a boolean value called header which tells me if I want to display or not the header for a specific column set. The autosize doesn't work.
var columnsSet = new UltraTreeColumnSet(); columnsSet.LabelPosition = header ? NodeLayoutLabelPosition.Default : NodeLayoutLabelPosition.None; var colName = new UltraTreeNodeColumn { Key = "Name" }; colName.AutoSizeMode = ColumnAutoSizeMode.AllNodesWithDescendants; columnsSet.Columns.Add(colName); var colStatus = new UltraTreeNodeColumn { Key = "Status" }; colStatus.AutoSizeMode = ColumnAutoSizeMode.AllNodesWithDescendants; columnsSet.Columns.Add(colStatus); var colMessage = new UltraTreeNodeColumn { Key = "Message" }; colMessage.AutoSizeMode = ColumnAutoSizeMode.AllNodesWithDescendants; columnsSet.Columns.Add(colMessage); return columnsSet;
If you want a column header for only the first node, assign the ColumnSet to the Override of the Nodes collection rather than each individual node. I'm not sure what you mean about the auto-size not working.
Thanks. With the autosize I mean that I want to make the second column and the third more large. I would like (like I do with your grid) to autosize the third column to cover the remaining space in the grid.
There is an UltraTree.ColumnSettings.AutoFitColumns property, but it is only applicable with OutlookExpress ViewStyle, and it only supports ResizeAllColumns, not ExtendLastColumn.
Anyway to help me on this??
Thank you