Limit max characters and show 3 dots along with tooltip


I want to restrict the characters upto certain counts, lets say 30. If the Text is longer than that, then i want to add 3 dots … and also the full text should be visible in tooltip.

refer following screenshot.

How can i do that?


That is described at and at, where you would constrain the text to a wider width.


Thanks. I enabled maxline and tooltip.

I want to show tooltip only if the overflow has added 3 dots. How can i add this condition in tooltip ?

Is it possible that when i click on the node, it show me full name ?


I’m not sure there’s an easy way to tell if the text has been truncated or if the ellipsis string is shown.

Instead of showing a tooltip, yes, you could have a click or other event reset the properties on the TextBlock so that it wasn’t limited to a certain number of lines or a certain height.