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
310
Display and hide nodes
posted

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;