1. Is there a quick way to change Connector's tooltip?
2. I want to prevent a connection creation in certain situations, e.g. create an unconnected node from one of sides. What is the best way to do it?
5 Answers, 1 is accepted
I'll try to answer you questions here:
1. Yes you can change the default tooltip of our connectors and the easiest way to do it is with custom localization manager:
public Example(){ InitializeComponent(); LocalizationManager.Manager = new CustomLocalizationManager();}public class CustomLocalizationManager : LocalizationManager{ public override string GetStringOverride(string key) { if ("Diagram_Connector".Equals(key)) return "custom connector tooltip"; return base.GetStringOverride(key); }}private void OnConnectionManipulationStarted(object sender, ManipulationRoutedEventArgs e){ if(e.Shape == someShapeIDon'tWantConnectionsFrom) e.Handled = true;}Regards,
Zarko
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thank you, Zarko.
1. However, what if I want a different tooltip for different connectors? Can I do it?
2. Thanks. It is work with ConnectionManipulationStarted, but if I do e.Handled = true within ConnectionManipulationCompleted nothing happens.
In order to do this you'll have to edit the template of the RadDiagramConnector and change it's toolTip to something like this:
<ToolTip Content="{TemplateBinding Tag}" />After this you could directly add the your connectors in xaml:
<telerik:RadDiagramShape Content="2" Position="300 100" UseDefaultConnectors="False"> <telerik:RadDiagramShape.Connectors> <telerik:RadDiagramConnector Name="Left" Tag="Connector 1" Offset="0 0.5" /> <telerik:RadDiagramConnector Name="Top" Tag="Connector 2" Offset="0.5 0" /> <telerik:RadDiagramConnector Name="Right" Tag="Connector 3" Offset="1 0.5" /> <telerik:RadDiagramConnector Name="Bottom" Tag="Connector 4" Offset="0.5 1" /> <telerik:RadDiagramConnector Name="Auto" Tag="Connector 5" Offset="0.5 0.5" /> </telerik:RadDiagramShape.Connectors></telerik:RadDiagramShape><telerik:RadDiagramShape Content="1" Position="100 100" UseDefaultConnectors="False" local:MyProperties.MyConnectors="{StaticResource connectors}" />I've attached a sample project so could you please examine it and if you have further questions feel free to ask.
Regards,
Zarko
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Hi There, I've a tricky question about connector and connection.
I need to develop a GUI where I can let the user define a connector by 3 points : A-start, C-end and a third one (B) to adapt the resulting curve to a set of points (to match the more it can the shape).
Once done, how can I access polyline parameters between A and B, B and C.
The main goal is to retrieve the equation between the three points. I know it can be done through an equation system solving, but do the TELERIK object is providing any useful attributes or methods?
Let me know please
We answered your question in the following forum thread. Please use only one new thread for new questions which are not related to questions in the current one. This will make the tracking and searching the forums easier. Thank you in advance for your understanding.
Regards,
Petar Mladenov
Telerik