Hello,
I want to display multiline text in a node of an ultraTree control. The text of the ultraTreeNode doesn't contain white spaces (It's composed of a one word). I set the property "ultraTree1.Override.Multiline" to true. But, I always have the horizontal scroll bar. This is my code "
appearance1.BorderColor = System.Drawing.Color.White; this.ultraTree1.Appearance = appearance1; this.ultraTree1.BorderStyle = Infragistics.Win.UIElementBorderStyle.None; this.ultraTree1.Dock = System.Windows.Forms.DockStyle.Fill; this.ultraTree1.FullRowSelect = true; this.ultraTree1.HideSelection = false; this.ultraTree1.Location = new System.Drawing.Point(0, 0); this.ultraTree1.Name = "_mediaTree"; _override1.ItemHeight = 30; _override1.MaxLabelHeight = 30; _override1.Multiline = Infragistics.Win.DefaultableBoolean.True; _override1.SelectionType = Infragistics.Win.UltraWinTree.SelectType.Extended; _override1.LabelEdit = DefaultableBoolean.False; this.ultraTree1.Override = _override1; this.ultraTree1.ShowLines = false; this.ultraTree1.ShowRootLines = false; this.ultraTree1.Size = new System.Drawing.Size(200, 370); this.ultraTree1.ViewStyle = ViewStyle.Standard;"
Is there something wrong in my code?
Thank you in advance
Hello Amal,
Thank you for posting in our forum.
You are not doing nothing incorrect. Right now there is no public method or property of UltraTree allowing you to wrap the text, when view style of the tree is set to Standard. However, you can achieve this by implementing a Creation Filter for your tree. In the creation filter you can change the size of the node text element, and the content will wrap as you need it. Check the attached sample project where I have implement this approach for you.
Please note, you can wrap the text if the view style is set to Grid or OutlookExpress. Follow the next link where you may find more information how to wrap the cells’ content http://help.infragistics.com/Help/Doc/WinForms/2016.1/CLR4.0/html/Infragistics4.Win.UltraWinTree.v16.1~Infragistics.Win.UltraWinTree.UltraTreeNodeColumn~CellWrapText.html.
After working on this the idea to be able to wrap the node text when the style of the tree is set to Standard was determined as a new product idea. You can post this idea, or vote for existing ones, at http://ideas.infragistics.com/.
Please let me know if you need any additional information.
Thank you for your help.
I tried your solution but I still can't have multiline text. It removes only the horizontal scroll bar. Maybe because I added left images to the treeNode.