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

Multiple node connection points?

3 Answers 232 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 05 Dec 2012, 04:31 PM
Currently evaluating your Diagram component. Looking through your samples, it's still a bit unclear if some features are supported or not.

Does your Diagram component support the following?
1) Multiple connection points on any side of the node. Preferably, distributed in such way that arrows from other nodes can be aligned horizontally. See connections.png.
2) Dynamic number of connection points. You start with one connection point. Once connected, a second one appears. Then a third one, and so on.
3) Building shapes programmatically? We have a plugin based framework where each plugin should be able to define its own customized shape, with its own number of connection points. and color. I imagine using one single node class for this, where some smart binding is used to produce the different shapes.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Francois Vanderseypen
Top achievements
Rank 2
answered on 05 Dec 2012, 05:20 PM
Kristoffer,

  1. connection points are called connectors and, yes, you can define your own custom connectors besides the predefined ones. We also have a so-called gliding connector which allows the connection point where a connection is attached to a shape to glide freely around the edge of a shape. In any case, the situation in your attached picture is possible.
  2. The API allows you to define connectors via code. The situation your describe would require some custom shape and logic but is possible (not explicitly checked or have a ready-made example for you though).
  3. You can use XAML control templates, the diagramming API, custom (path) geometry which you can copy from Expression Blend (or even SVG)...to define and add shapes. Creating shape geometry and logic on the fly is somewhat unusual however, most business situations dictate in advance the shape's geometry (look 'n feel) and behavior but your pluggable system is an interesting angle. 

I can guess from your short description that customizing RadDiagram will take time and possibly some deep changes, likely not within the boundaries of Telerik's source code agreements (section 5.3.4). You can contact Telerik Consulting if you wish to go beyond the box.

Hope this helps, Fr.
0
Sammy
Top achievements
Rank 1
answered on 14 Apr 2014, 01:27 PM
Hello,

I have quite same requirements. What I need is, I would like the diagram component to handle the multiple connection points it self, but taking into consideration that 1 connector has only 1 connection (1 to 1). e.g. the nearest connector is already attached to for another connection, attach the next nearest connector.

How can i implement this?

Thanks in advance,
0
Zarko
Telerik team
answered on 17 Apr 2014, 08:23 AM
Hello Sammy,
Could you please elaborate a little bit more on your scenario ? Also could you explain what exactly do you mean by "diagram component to handle the multiple connection points it self" ?  
At the moment the easies way to customize the connection manipulation is to handle the ConnectionManipulationStarted and ConnectionManipulationCompleted events and add some custom logic there e.g.:
private void OnConnectionManipulationCompleted(object sender, Telerik.Windows.Controls.Diagrams.ManipulationRoutedEventArgs e)
{
    e.Handled = true;
 
    // Change the currently manipulated connection with a new one with different target connector.
    var newConnection = new RadDiagramConnection();
    newConnection.Source = e.Connection.Source;
    newConnection.SourceConnectorPosition = e.Connection.SourceConnectorPosition;
    newConnection.Target = e.Shape;
    if (e.Shape != null)
        newConnection.TargetConnectorPosition = e.Shape.Connectors[1].Name;
 
    this.diagram.AddConnection(newConnection);
}
We're looking forward to hearing from you.

Regards,
Zarko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Diagram
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Francois Vanderseypen
Top achievements
Rank 2
Sammy
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or