Hi,
I would like to display custom tooltip for each node and connector at runtime.
But how do I set the tooltip content, so that each time the user make a mouseover a custom message can be shown?
|
DiagramConnector connector = new DiagramConnector()
{
Id = "connector1",
SourcePoint = new ConnectorSourcePoint() { X = 300, Y = 300 },
TargetPoint = new ConnectorTargetPoint() { X = 400, Y = 400 },
Constraints= ConnectorConstraints.Default| ConnectorConstraints.Tooltip,
Tooltip = new ConnectorTooltip()
{
//Sets the content of the tooltip
Content = "Connector",
//Sets the position of the tooltip
Position = Syncfusion.Blazor.Popups.Position.BottomRight,
//Sets the tooltip position relative to the node
RelativeMode = TooltipRelativeMode.Object
}
};
ConnectorCollection.Add(connector); |
Thanks, I got that running now.
One more tooltip question. Can I format the tooltip so it is displayed as multi lines with line breaks?
Right now I can set the height of the tooltip. But the text is shown as one long line even that I insert "Environment.NewLine" into the text.
Please see attached screendump for example
Code used:
toolTipText = string.Empty;
for (int i = 0; i < 4; i++)
toolTipText += $"Line number: {i.ToString()} {Environment.NewLine}";
|
for (int i = 0; i < 4; i++)
{
node.Tooltip.Content += $"<div>Line number: {i.ToString()}</div>";
} |