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.

How can I set a diagram readonly?

Thread ID:

Created:

Updated:

Platform:

Replies:

26450 Mar 23,2005 07:10 AM Sep 28,2006 01:00 PM Windows Forms 15
loading
Tags: Diagram
Tommy Norman
Asked On March 23, 2005 07:10 AM

Hi, How can I set the diagram to only allow viewing? but still keep tools like zooming and paning working. Best Regards Tommy

Administrator [Syncfusion]
Replied On March 23, 2005 11:30 AM

Hello Tommy, Diagram user interactivity is enabled through the interactive Tools registered with the Diagram''s Controller. To disable interactivity, you will have to iterate the list of Tools, and selectively enable/disable each tool depending on the functionality that you want to retain. The following code should give you an idea, // Get the collection of registered Tools, and disable functional aspects that are not required Syncfusion.Windows.Forms.Diagram.Tool[] tools = this.diagramComponent.Controller.GetAllTools(); foreach(Tool tool in tools) { // Retain the Enabled state for the Zoom and Pan tools if((tool.Name == "ZoomTool") || (tool.Name == "PanTool")) continue; tool.Enabled = false; } Regards, Prakash Surendra Syncfusion Inc,

Tommy Norman
Replied On March 24, 2005 06:38 AM

Okey thanks for the tool tip, However, how can I prevent users from droping new symbols into the diagram and how can I prevent them from moving symbols around. Of cource I could add a authority check in each diagram event handler but if there are a more elegant solution I would be glad. I was looking for some readonly property similar to what exists in the gridcontrol but haven''t found one. Setting the diagram to disabled fixes most of the issues but then I can''t zoom and I can scroll, this features I still want to have active. The reason for this need is that I have to build in support for usermanagement. If the user doesn''t have permission to edit he should still be able to view the diagram. Best Regards Tommy

Tommy Norman
Replied On March 24, 2005 06:41 AM

Sorry an error sneaked into my previous post. It should be "I can''t scroll". Regards Tommy

Administrator [Syncfusion]
Replied On March 24, 2005 03:00 PM

Hi Tommy, Disabling all the diagram interactive tools, except the Zoom and Pan as shown above, will disable the selection tool as well. Once the above method is invoked users will no longer be able to select nodes in the diagram, till the tools are re-enabled. The control''s scrolling behavior will not be affected in any way. To prevent new symbols from being dropped onto the diagram, simply set the diagram control''s Diagram.AllowDrop property to FALSE. Regards, Prakash Syncfusion Inc.,

Antonio Rodriguez Lezcano
Replied On July 10, 2006 11:38 AM

I did and worked, but now, with the last version doen''t exist any "Enable" property. I''ve tried with "DeactiveTool()" and setting null to "ActiveTool" but doesn''t work. How to do it in the current version? thanks >Hello Tommy, > >Diagram user interactivity is enabled through the interactive Tools registered with the Diagram''s Controller. To disable interactivity, you will have to iterate the list of Tools, and selectively enable/disable each tool depending on the functionality that you want to retain. The following code should give you an idea, > >// Get the collection of registered Tools, and disable functional aspects that are not required > >Syncfusion.Windows.Forms.Diagram.Tool[] tools = this.diagramComponent.Controller.GetAllTools(); >foreach(Tool tool in tools) >{ > // Retain the Enabled state for the Zoom and Pan tools > if((tool.Name == "ZoomTool") || (tool.Name == "PanTool")) > continue; > tool.Enabled = false; >} > >Regards, >Prakash Surendra >Syncfusion Inc, >

Administrator [Syncfusion]
Replied On July 10, 2006 02:49 PM

Hi Antonio, Thank you for using Syncfusion products. If your intension is to deactivate the currently active Tool then please, refer the following code snippet, // Activates the particular Tool. diagram.Controller.ActiveTool = /* particular Tool object */ // Automatically activates the SelectTool by default. diagram.Controller.ActiveTool = null; I hope I have not misunderstood your question. Please let us know if you have any queries regarding this issue. We will be glad to assist you. Thanks, Meera.

Antonio Rodriguez Lezcano
Replied On July 12, 2006 11:07 AM

What I want to do is set my diagram as read Only, just allowing functions like zoom. In previous versions I used your code going through every tool and setting enabled=false to those which I didn''t want to be used, but now there is no "enabled" property so I don''t know how to disable those tools for the read only behavior. > >Hi Antonio, > >Thank you for using Syncfusion products. > >If your intension is to deactivate the currently active Tool then please, refer the following code snippet, > >// Activates the particular Tool. > >diagram.Controller.ActiveTool = /* particular Tool object */ > >// Automatically activates the SelectTool by default. > >diagram.Controller.ActiveTool = null; > >I hope I have not misunderstood your question. Please let us know if you have any queries regarding this issue. We will be glad to assist you. > >Thanks, >Meera. >

Administrator [Syncfusion]
Replied On July 12, 2006 04:35 PM

Hi Antonio, If your intension is to activate only Pan and Zoom tool, you can do this by using either this.diagram1.Controller.ActiveTool property or this.diagram1.Controller.ActivateTool(...) method. I am sending you a sample application to show this code implementation. Kindly look at the attached sample''s toolBar1_ButtonClick() method which will give you an idea on what you are looking for. Thanks, Meera.

DrawShapes.zip

Antonio Rodriguez Lezcano
Replied On July 18, 2006 12:37 PM

My intention is put it as ReadOnly i.e. don''t allow the user move, insert or remove nodes for example. > >Hi Antonio, > >If your intension is to activate only Pan and Zoom tool, you can do this by using either this.diagram1.Controller.ActiveTool property or this.diagram1.Controller.ActivateTool(...) method. I am sending you a sample application to show this code implementation. > >Kindly look at the attached sample''s toolBar1_ButtonClick() method which will give you an idea on what you are looking for. > >Thanks, >Meera.

DrawShapes.zip

Administrator [Syncfusion]
Replied On August 8, 2006 01:12 AM


Hi Antonio,

We regret for this delay in getting back to you.

If your intention is to restrict the user from moving,inserting or removing the nodes then you can go with this by using the diagram.ChildrenChanging event.This event gets fired before the collection of child nodes are changed.Set the event arguments.Cancel property to true if you need to avoid inserting /removing the symbol nodes.Similarly, you can restrict the user from moving the nodes as well using the EditStyle.AllowMove property.

I have modified the above posted sample as per your requirement for your reference,kindly look into it and do let us know if we can be of further assistance to you.

Thank you for your patience.

Regards,
Praveena.

DrawShapes0.zip

Antonio Rodriguez Lezcano
Replied On September 7, 2006 12:33 PM

Doing it that way, I won''t be able either to insert or remove programatically. I don''t want the user to change the diagram but me.

J.Nagarajan [Syncfusion]
Replied On September 20, 2006 07:29 PM

Hi Antonio,

Sorry for the delay in getting back to you. If your intention is to insert or remove the symbols programmatically and restrict the user from moving , inserting or removing the nodes then please refer the attached sample. In this sample when you set the Diagram.AllowDrop property to false, then you can not drag the symbols from the palette.

Similarly, you can restrict the user from moving the nodes as well using the EditStyle.AllowMove property.

I hope this will meet your requirement. Please let me know if you have any questions

Thanks for using Syncfusion products.

Regards,
Nagaraj


ReadOnlyDiagram.zip


Antonio Rodriguez Lezcano
Replied On September 25, 2006 05:43 AM

How can I avoid the BitmapNode''s to be selected?

J.Nagarajan [Syncfusion]
Replied On September 27, 2006 01:39 PM

Hi Antonia,

Currently we have no special feature to set the Bitmap node as Readonly. However we will forward this issue to our development team and will implement this feature in our furure releases.

Thanks for your interest in Essential Diagram.

Regards,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On September 28, 2006 01:00 PM

Hi Antonio,

Sorry for the inconvenience caused. If your intention is to avoid the bitmap node to be selected then please refer the attached sample. You can also avoid the bitmap to be moved by using the following code.

private void newDiagram_Controller_ToolActivate(object sender, Syncfusion.Windows.Forms.Diagram.DiagramController.ToolEventArgs evtArgs)
{
if(evtArgs.Tool.Name=="MoveTool" && this.newDiagram.SelectionList.First is BitmapNode)
{
MoveTool tool=(MoveTool)evtArgs.Tool;
this.newDiagram.Controller.ActiveTool=null;
}
}

I hope this will meet your requirement. Please let me know if this helps for you.Thanks for using Essential Diagram.

Regards,
Nagaraj

BitmapNodeSelection.zip



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.

;