We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to disable Line connectors

Thread ID:





98155 Feb 10,2011 03:08 AM UTC Mar 23,2011 09:15 AM UTC WPF 3
Tags: Diagram
Arthur Amshukov
Asked On February 10, 2011 03:08 AM UTC


At some point I have to prevent any manipulations with Line connectors in Diagram control (switching from design to runtime mode for example). I use Allow/IsXXX properties and PreviewXXX events for nodes but I cannot see how to do it for connectors. I used something like:

connector.AllowDrop = false;
connector.IsEnabled = false;
connector.IsLabelEditable = false;

I cannot disable the entire Diagram control as I still need to select nodes and process double-click events. Any info is highly appreciated.

Thank you,

Arthur Amshukov

Maria Amal Raj T [Syncfusion]
Replied On February 11, 2011 12:25 PM UTC

Hi Arthur,

Thanks for your interest on Syncfusion Products.

When the DiagramView's IsPageEditable property is set to false Editing options will be disables, and operations link selecting and dragging the Nodes and LineConnector is not possible. To prevent only line related operations, please set IsHitTestVisible property to false. This will hide the LineConnector to receive any mouse related operations.

Code Snippet:

1. To Disable DiagramControl:

DiagramView diagarmView=new DiagramView();

2. To Disable LineConnectors without affecting Node:

//set to IsPageEditable to true.
DiagramView diagarmView=new DiagramView();

//set to LineConnector's IsHitTestVisible to false.
LineConnector connector = new LineConnector();
connector.IsHitTestVisible = false;

From the second method Node Select and double click event also fire without any changes in the LineConnectors.

Please let me know if you have any further queries.

Maria Amal Raj T.
(Diagram WPF and Silverlight Team)

Mary Fontana
Replied On March 22, 2011 06:30 PM UTC

A related question.

How do you disable moving of line connectors, but still allow the connector show a tool tip?

If I do line.IsHitTestVisible = false; The tooltip is also disabled.

Maria Amal Raj T [Syncfusion]
Replied On March 23, 2011 09:15 AM UTC

Hi Mary,

By setting IsHitTestVisibility to false will hide the line from the mouse related operations. So, tool tip will not appear. Currently, disabling LineConnector from dragging is not supported. However, as a workaround, the Decorator shares and the Vertex can be hidden, which in turn disables Line from getting dragged as shown in the following code snippet.

Code Snippet :

LineConnector line = new LineConnector();
//Hide the Vertex
line.IsVertexVisible = false;
//Hide the Decorator shares
line.DecoratorAdornerStyle = this.Resources["HidenThumb"] as Style;
//Disable label editing
line.IsLabelEditable = false;
line.ToolTip = "NewToolTip";

Maria Amal Raj T,
Diagram WPF & Silverlight Team,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon