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.
Unfortunately, activation email could not send to your email. Please try again.

Disable the nodes in a Layer.

Thread ID:

Created:

Updated:

Platform:

Replies:

100390 Aug 3,2011 08:59 AM Aug 5,2011 04:40 AM Windows Forms 2
loading
Tags: Diagram
John Previn Kumar
Asked On August 3, 2011 08:59 AM

I want add rectangles in a layer and circles in a different layer. If I call Layer.Visible = false, all the nodes added to the corresponding layer is hidden. But when I call Layer.Enabled = False I could still work on nodes on that layer? How do I make all nodes in a layer "Read Only"? I should also be able to go to a mode in which I can do modifications.



John Previn Kumar
Replied On August 5, 2011 04:32 AM

Should I loop thru all nodes in the layer and make Enabled as false? or is there a way to make entire Layer disabled?


Amsath Ali M [Syncfusion]
Replied On August 5, 2011 04:40 AM

Hi JVM,

Thanks for your interest in Syncfusion products.

The Layer.Enabled property is used to indicate whether the layer should be active or not, where by default it is set to ‘False’. We suggest you to loop through all nodes in a layer and use the Node’s ‘Editstyle's’ properties to make nodes in a layer as ‘Readonly’. Please refer the below code snippet to achieve your requirement.
[C#]
foreach (Node node in layer.Nodes)
{
node.EditStyle.AllowChangeHeight = false;
node.EditStyle.AllowChangeWidth = false;
node.EditStyle.AllowRotate = false;
node.EditStyle.AllowMoveX = false;
node.EditStyle.AllowMoveY = false;
}

For more information about Layers, please visit the below online UG link:
http://help.syncfusion.com/ug_92/User%20Interface/Windows%20Forms/Diagram/Documents/444layers.htm

For your convenience, we have created a simple sample to achieve your requirement.
Please try the below sample and let us know if you have any queries.
Layer test1125834057.zip

Regards,
Amsath Ali. M




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.

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.

;