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

Custom validation of a connection

Thread ID:





119688 Jul 22,2015 02:44 AM UTC Jul 23,2015 09:50 AM UTC WinForms 1
Tags: Diagram
Johan De Mulder
Asked On July 22, 2015 02:44 AM UTC


When trying to connect incompatible connection points (such as two outputs - ConnectionPointType.Outgoing), the cursor changes to the 'no' (prohibiting) sign. That is great.
But how do I add additional conditions to this validation. For instance, how do I show a 'no' cursor when the user tries to connect the central connection point of a circle to that of a square (with ConnectionPointType.IncomingOutgoing)?

Many thanks,

Naganathan Ganesh Babu [Syncfusion]
Replied On July 23, 2015 09:50 AM UTC

Hi Johan,
Thanks for using Syncfusion Products.
We have created simple sample to achieve your requirement. We suggest you to use Diagram.Controller.ActiveTool’s “ActionCursor” property to set the Cursors.No in order to achieve your requirement. Please refer the below code snippet and sample for your reference.
Here is the code snippet:

diagram2.MouseMove += diagram2_MouseMove;

diagram2.MouseDown += diagram2_MouseDown;
diagram2.MouseUp += diagram2_MouseUp;

void diagram2_MouseUp(object sender, MouseEventArgs e)


      handle = null;

      diagram2.Controller.ActiveTool.ActionCursor = Cursors.Default;


void diagram2_MouseDown(object sender, MouseEventArgs e)


   HandlesHitTesting.GetEndPointAtPoint(diagram2.Model.Nodes, e.Location, ref handle);


void diagram2_MouseMove(object sender, MouseEventArgs e)


   if (handle != null)


    Node node = diagram2.Controller.GetNodeAtPoint(e.Location);

    if (node != null && !(node is ConnectorBase) && (node is Ellipse) && node.CentralPort.ConnectionPointType == ConnectionPointType.IncomingOutgoing)


       diagram2.Controller.ActiveTool.ActionCursor = Cursors.No;




       diagram2.Controller.ActiveTool.ActionCursor = Cursors.Cross;



Here is the sample:
Please let us know if any concerns.
Naganathan K G


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