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

'System.InvalidOperationException' occurred in Telerik.Windows.Controls.Diagrams.dll, The shape has no connectors defined.

1 Answer 140 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Robbie
Top achievements
Rank 1
Robbie asked on 30 May 2014, 04:12 AM
I have a RadDiagramTextShape without connectors.  I don't want to connect to text shapes.

So I clear then using this line of code:

    ((RadDiagramTextShape)Shape).Connectors.Clear();

My problem is when a user changes to the Connector Tool ( diagram.ActiveTool = MouseTool.ConnectorTool) and clicks within the RadDiagramTextShape  an unhandled exception is thrown:

An unhandled exception of type 'System.InvalidOperationException' occurred in Telerik.Windows.Controls.Diagrams.dllAdditional information: The shape has no connectors defined.

Is there a way to prevent this? 

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 02 Jun 2014, 11:48 AM
Hi Robbie,

When the ActiveTool is the Connector Tool and you click on a shape, the RadDiagram tries to create a connection starting from the nearest connector of the shape. However, in your case this shape does not have a connectors and the diagram deliberately throws an exception - "The Shape has no Connectors".

 If this does not fit in your scenario а possible way to go is to create custom ConnectionTool. You can find a sample implementation in the attached solution. Furthermore, you can explore these help resources:

Telerik XAML GitHub Repository: Diagram Custom Tools Demo
RadDiagram Tools Customization

Regards,
Petar Mladenov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Diagram
Asked by
Robbie
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or