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.
Thank you for your feedback.
Can you please provide me a sample project demonstrating the issue you are facing? Please note, without sample reproducing this behavior at our side there is not much we can do.
Please check also if you have set some additional properties in respect to my sample. If you find such properties please send me the list of them, as well as the value you have set them to.
Looking forward to your reply.
I run your sample on my desktop. The multiline text is rendred correctly. But when I tried it on our application, this doesn't change anything, only the horizontal scroll bar is removed. I don't know why the multiline text isn't displayed correctly in our application.
I have also added images to the left of the nodes, and still the text in the nodes wraps. Please check the attached sample I have tested this with and let me know what the result at your side is.