This is a migrated thread and some comments may be shown as answers.

Connectors and Connections

5 Answers 224 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Dmitriy
Top achievements
Rank 1
Dmitriy asked on 04 Jun 2013, 02:33 PM
I have a couple of questions:

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

Sort by
0
Zarko
Telerik team
answered on 05 Jun 2013, 03:28 PM
Hi Semyon,
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();
}
and
public class CustomLocalizationManager : LocalizationManager
{
    public override string GetStringOverride(string key)
    {
        if ("Diagram_Connector".Equals(key))
            return "custom connector tooltip";
 
        return base.GetStringOverride(key);
    }
}
2. You should try out the ConnectionManipulationStarted and ConnectionManipulationCompleted events and handle them if you don't want to create this connection with something like this:
private void OnConnectionManipulationStarted(object sender, ManipulationRoutedEventArgs e)
{
    if(e.Shape == someShapeIDon'tWantConnectionsFrom)
        e.Handled = true;
}
I hope I was able to help you and if you have further questions please feel free to ask.

Regards,
Zarko
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dmitriy
Top achievements
Rank 1
answered on 06 Jun 2013, 11:34 AM

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.

 

0
Zarko
Telerik team
answered on 10 Jun 2013, 04:01 PM
Hi Semyon,
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}" />
because it uses our LocalizationManager by default.
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>
or use custom attached property:
<telerik:RadDiagramShape Content="1"
                 Position="100 100"
                 UseDefaultConnectors="False"
                 local:MyProperties.MyConnectors="{StaticResource connectors}" />
The second issue should be fixed in our next official release later this week.
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.

0
Jeff
Top achievements
Rank 1
answered on 30 Jun 2015, 04:01 PM

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

0
Petar Mladenov
Telerik team
answered on 03 Jul 2015, 07:11 AM
Hello Jeff,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Diagram
Asked by
Dmitriy
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Dmitriy
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or