Hi,
I've determined that the UltraTree (with FreeForm ViewStyle) does not have a method for automatically sizing the node height to fit wrapped text if CellWrapText=true. I need the cell text to wrap though, so I'm trying to calculate the height of the wrapped text so I can set PreferredCellSize appropriately to show the entire text. Is there a reliable way to do this? I've tried using TextRenderer.MeasureText() with different combinations of TextFormatFlags and Graphics.MeasureString(), but neither one has given me reliably accurate results. Is there a way to get the number of wrapped lines directly from the cell/column object? If not, what would you recommend I use for measuring the text height?
Thanks,
Cassio
Hello,
Could you please let me know the exactly version of Infragistics that you are using. Also is it possible to post a simple sample that demonstrates your issue. I want to see how many lines of text you need to display in a single node.
I ma waiting for your feedback.
Hi Hristo,
I'm using version 2011.2 for Windows Forms (although we'll be upgrading to 2013 soon, so let me know if that will make any difference). The text that needs to be displayed can range from a single word to several lines. The control is being used in a tooltip-like form whose width is variable, so the width available for the columns are dynamically calculated. I want to be able to fit the columns into the form without horizontal scrolling, so if the text has to wrap I need to increase the height of the node to show all the text (vertical scrolling is ok).
I've attached a sample project to demonstrate. Column3 has a long multi-line sample text that wraps in the cell. You can resize Column 3 and it will try to calculate the right height for the cell. It usually leaves a certain amount of whitespace at the bottom of the text, so the calculated height is too tall. The amount of whitespace changes depending on the width of the column, and sometimes it actually gets it right on.
Thank you for your feedback.
Please let me know if you need my further assistance on this matter.
My tree has multiiple node levels, each with its own column set. I'm not sure how I would accomplish that with the UltraGrid. At this point, I have it working well enough to move on and it would require too much effort to try to switch to an UltraGrid.
Thanks for your suggestions and help though.
Maybe you could use UltraGrid instead of UltraTree, and to add additional column “Node” and to group your grid by this column.
I hope that this will helps you.
I still have the problem that I cannot accurately calculate the height of the cell. The "Auto resize row height" feature will get rid of the problem if it ever makes it into the product, but I still should be able to do this. If I knew exactly how the text is being rendered in the cell, I could use the same flags to measure the text.
Hello,
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.