How to Prevent Shapes from Being Connected to Themselves

Environment

Product Version 2018.2.515
Product RadDiagram for WPF

Description

How to prevent a RadDiagramShape to connect to itself when you single click on one of its connector points.

Solution

To prevent this use one of the following two solutions:

Solution #1

Set the ReflexiveRouter of RadDiagram to null.

this.diagram.RoutingService.ReflexiveRouter = null; 

Solution #2

Handle the ConnectionManipulationCompleted event of RadDiagram, if the connection source is the same as the Shape of the event arguments.

private void RadDiagram_ConnectionManipulationCompleted(object sender, Telerik.Windows.Controls.Diagrams.ManipulationRoutedEventArgs e) 
{ 
    if (e.Connection.Source == e.Shape) 
    {            
        e.Handled = true; 
    } 
} 

See Also

In this article
Not finding the help you need? Improve this article