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

Disabling CentralPort of line

Thread ID:

Created:

Updated:

Platform:

Replies:

78154 Dec 2,2008 11:35 AM UTC Dec 2,2008 12:09 PM UTC WinForms 2
loading
Tags: Diagram
MagicXtr
Asked On December 2, 2008 11:35 AM UTC

Hi,

I would like to know whether it is possible to disable CentralPort of line. As far as I know such goal can be easily achieved when connection is established programmatically (by setting EnableCentralPort = false). However in my case connection can be added manually (e.g. user clicks appropriate menu item and LineLinkTool is activated). As a result user can draw line from rectangle to another line. But it should not be possible to add a connection between links - only rectangles must be connected through the links. Could you please provide me with idea of how to disable line ports so that it will be impossible to connect the lines?

Thanks,
Bork


Administrator [Syncfusion]
Replied On December 2, 2008 11:53 AM UTC

Hi Bork,

The Central Port of the Line can be disabled using the Model.EventSink's NodeCollectionChanged Event handler and performing the following code:

*****
if (evtArgs.Element is LineConnector)
{
LineConnector lc = evtArgs.Element as LineConnector;
lc.EnableCentralPort = false;
}
*****

Let me know if this helps.

Happy Coding!

- Ajeet



>Hi,

I would like to know whether it is possible to disable CentralPort of line. As far as I know such goal can be easily achieved when connection is established programmatically (by setting EnableCentralPort = false). However in my case connection can be added manually (e.g. user clicks appropriate menu item and LineLinkTool is activated). As a result user can draw line from rectangle to another line. But it should not be possible to add a connection between links - only rectangles must be connected through the links. Could you please provide me with idea of how to disable line ports so that it will be impossible to connect the lines?

Thanks,
Bork




MagicXtr
Replied On December 2, 2008 12:09 PM UTC

Thanks a lot. It's even easier than I've thought:)


CONFIRMATION

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

or the page will be automatically redirected to 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

;