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
285
Figuring out height of text in UltraTree with CellWrapText=true
posted

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