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. Image for the cookie policy date

Delete Ports

I've been trying to make my code dynamically create a port when I move a connection to its side, currently my code is working perfectly except I know no way to delete the unused ports that I create from the nodes.

I am using the ConnectorSourceChangedEvent and ConnectorTargetChangedEvent handlers and when I remove the Ports inside the handler I get
"An unhandled exception of type 'System.NullReferenceException' occurred in Syncfusion.SfDiagram.Wpf.dll"
and a
"An unhandled exception of type 'System.InvalidOperationException' occurred in System.Core.dll
Additional information: Sequence contains no elements"
if I also set the connector.SourcePort as null.

Am I doing something wrong here?

8 Replies

KR Keerthivasan Ramamoorthy Syncfusion Team December 8, 2016 01:02 PM UTC

Hi Bjarni, 
 
We suspect your requirement is “Need to Drag the port at run within Node Boundaries”. Currently, we don’t have a support to achieve your requirement. We have considered your requirement as feature. We will implement and include this feature in our volume 1,2017 release which is tentatively scheduled to be rolled out by the end of January.  We have provided video to represent this feature. Please refer the video as below. 
 
 
 
Note: 
If our definition of this feature is different from your requirement, then let us know the specific details like Video/Screenshot, so that we can work towards fulfilling your requirement. 
 
Regards, 
Keerthivasan R. 
 
 



RB Rikhardur Bjarni Einarsson December 8, 2016 01:40 PM UTC

Thank you for the headsup, I figured out how to make a class using the ConnectorSourceChangedEvent and ConnectorTargetChangedEvent, I had to build a lot of logic around it but I got it working.  Now I'm having another problem that segments seem to behave weirdly when I put two ports on the same axis

If you look at the top of the connector you can see a black line going to the left, I got it by positioning the points on exactly the same x point, dragged it to the right and back to the left.
When I went over the point again the connector got stuck, aka wouldn't go more to the right and this hook appeared.


RB Rikhardur Bjarni Einarsson December 8, 2016 01:41 PM UTC

http://imgur.com/a/SgHLO
Link since the image didnt appear


RB Rikhardur Bjarni Einarsson December 8, 2016 01:41 PM UTC

http://imgur.com/L7p1Zga


KR Keerthivasan Ramamoorthy Syncfusion Team December 9, 2016 11:38 AM UTC

Hi Bjarni,  
Could you please provide more details like sample/video to reproduce the reported issue “Connector Segment look weirdly”? This helps us to find the exact root cause of the issue. However, we have analyzed the provided screenshot and we could not reproduce the reported issue.   
Regards, 
Keerthivasan R. 
 
 



RB Rikhardur Bjarni Einarsson December 9, 2016 11:44 AM UTC

Video showcasing the problem

Attachment: Program_c69173cb.zip


RB Rikhardur Bjarni Einarsson December 9, 2016 02:00 PM UTC

Another bug I found while testing

Attachment: Bug_da34d178.zip


AP Ashwini Paranthaman Syncfusion Team December 12, 2016 07:45 AM UTC

Hi Rikadhur, 
A new incident has been created under your account for your requirement. Please log on to your direct trac account for further updates. 
Regards, 
Ashwini P. 


Loader.
Up arrow icon