Way to make resizable TextBlock use ellipsis?

I have a node with an icon on top and TextBlock on the bottom. When the user resizes the node it gives more space to the TextBlock and is currently clipping. What I would like to do is set overflow to TextBlock.OverflowEllipsis but that requires wrap none or maxLines to be set. I don’t want either of these set because I want the TextBlock to automatically grow. Is there a way to do this?

I don’t understand what you want. It seems contradictory to me that you want ellipsis yet you don’t want to specify any kind of limit to allow ellipsis to happen. If the TextBlock can grow arbitrarily tall, there is no need for any ellipsis.

Perhaps two screenshots or sketches would help illustrate the normal behavior and the elided behavior that you want.

The node is user resizeable and not automatic. By default it will show 2 lines (based on height not by lineCount) but they can resize it if they want to allow the full text to show.

Default size:

After user manual resize:

In the first pic I would like ellipsis to show since the full text isn’t being displayed.

Ah, you are clipping the TextBlock rather than forcing the TextBlock to have a height and width that fits in the available area. I bet you’re using a “Vertical” Panel.

Try this instead:

    myDiagram.nodeTemplate =
      $(go.Node, "Table",
        { resizable: true },
        $(go.Shape, { row: 0, fill: "white", width: 30, height: 30 }),
        $(go.TextBlock, { row: 1, stretch: go.GraphObject.Fill, overflow: go.TextBlock.OverflowEllipsis },
          new go.Binding("text"))
      );

Of course replace the Shape with whatever you are using for the icon.

I think you’re clipping the TextBlock because it appears that the top of the letters “ll” of the word “Really” seems to still be visible at the bottom of the node. In fact they almost look like “…”.

Thanks - changing Vertical to Table was the trick.

A post was split to a new topic: Ellipsis and multi-value attributes