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

Disabling CentralPort of line

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


2 Replies

AD Administrator Syncfusion Team 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





MA MagicXtr December 2, 2008 12:09 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon