Set DiagramWebControl edit state

Hello

I'm trying to set the DiagramWebControl to be uneditable.
In the other words, all nodes and links can't be edit, move, delete or create a link.
Is there any property or method can easy to achieve?
Or I should make a lot of hard code? eg. detect node move => cancel node move...ect

thanks!!!

1 Reply

AA Amsath Ali M Syncfusion Team May 21, 2012 07:32 AM UTC

Hi

 

Thanks for your interest in Syncfusion products.

 

We suggest you to use the Node.EditStyle’s ‘AllowMoveX/Y, AllowChangeWidth/Height, AllowDelete and AllowRotate’ properties and set the Node’s ‘EnableCentralPort’ property as ‘false’ to make a node uneditable. Please refer the below code snippet to achieve your requirement.

 

Here is the code:

[C#]

Ellipse ellp = new Ellipse(100, 100, 100, 70);

                ellp.FillStyle.Color = Color.Aqua;

                ellp.FillStyle.Type = FillStyleType.LinearGradient;

 

                //To Make Ellipse uneditable

                // Node's Height cannot be changed.

                ellp.EditStyle.AllowChangeHeight = false;

                // Disables the changing of Node's Width

                ellp.EditStyle.AllowChangeWidth = false;

                //Indicates whether moving along X axis is allowed or not.

                ellp.EditStyle.AllowMoveX = false;

                //Indicates whether moving along Y axis is allowed or not.

                ellp.EditStyle.AllowMoveY = false;

                //Gets or sets a value indicating whether object can be deleted.

                ellp.EditStyle.AllowDelete = false;

                // Gets or sets a value indicating whether the object can be rotated.

                ellp.EditStyle.AllowRotate = false;

                // Gets or sets a value indicating whether central port is enabled.

                ellp.EnableCentralPort = false;

                ellp.Ports.Clear();

 

                DiagramWebControl1.Model.AppendChild(ellp);         

 

Here is the sample:

<a rel='nofollow' href='http://www.syncfusion.com/downloads/Support/DirectTrac/94299/F103628-DgmUnditable-993984491.zip'>F103628-DgmUnditable-1017764361.zip</a>

 

Please try the above sample and let us know if you have any queries.

 

Regards,

Amsath Ali. M



F103628-DgmUnditable_7b9dde3b.zip

Loader.
Up arrow icon