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

Pan to center when moving node from outside the bounds

Good day,

Is there a property to disable the "pan to center" operation that occurs when a node is moved outside the bounds?

Thank you for your time,


3 Replies

SC Sudhakar C Syncfusion Team August 21, 2013 05:44 AM UTC

Hi Mathieu,


We are unable to understand your query. Can you please provide more information about your requirement. However, we can disable the Panning by disable the IsPanEnabled property of the diagram view. Please refer the below code snippet.


Code Snippet:


// Enable the Panning

diagramView.IsPanEnabled = true;


// Disable the Panning

diagramView.IsPanEnabled = false;



Please let us know if you have any concerns on this.




Sudhakar C


MM Mathieu Myrand Bolduc August 21, 2013 12:09 PM UTC

It is easier to see if you try it.

1 - Run the project
2 - Pick a node
3 - Drag the node outside the bounds
4 - Drop the node
5 - Pick the node and move it towards its original place.

When you move the node from outside the bounds, it re-centers automatically the view, a bit like panning.  This is the behavior I would like to stop and I was wondering if I had missed an option, or if I have to do it manually by stretching the bounds.

Thank you


SC Sudhakar C Syncfusion Team August 22, 2013 10:51 AM UTC

Hi Mathieu,


By default, the size of the diagram page is depending on the elements which are placed in the diagram page. So, when we move the element to outside of the diagram page’s bounds, the diagram page size will be changed based on that element.


For example,  Consider a single Node is placed in the position of 250,250 and the size of that node is 100,100. Now, the size of the diagram page will be (Position of the Node + size of the Node) 350,350. If we move that node to the position of (500,500), the size of the diagram page also changed to (600,600). And also, if we move that node to the position of (100,100), the size of the diagram page is also changed to (200,200). For more information please refer the attached video (Video Name : BehaviourVideo) . In that video, the coloured area is diagram page.


In your scenario. when move the Node from outside of the diagrampage’s bounds to inside, the size of the diagram page is changed. So that we can see the behaviour like panning. This is not an issue. This is a current behaviour.


However, if you want to stop this behaviour, we are suggested you to please use the BoundaryConstraintsArea property of DiagramView. BoundaryConstraintsArea is used to define the diagram page size. Please refer the code snippet.


Code Snippet :



// Enable the BoundaryConstraintsEnabled property

diagramView.BoundaryConstraintsEnabled = true;


//Set value the BoundaryConstraintsArea

diagramView.BoundaryConstraintsArea = new Rect(0, 0, 1000, 600);


// Disable the SizeToContent property

diagramView.SizeToContent = false;



For more information about the BoundaryConstraintsArea, please refer our Syncfusion online documentation using the below link.


Documentation Link : http://help.syncfusion.com/ug/wpf/diagram/default.htm#!Documents/46272definingdiagrampage.htm


Note :  We should  enable the BoundaryConstraintsEnabled property of the diagram view and also we should disable the SizeToContent property of the diagram view, when we use the BoundaryConstraintsArea.


Please let us know if you require further assistance on this.




Sudhakar C  


Live Chat Icon For mobile
Up arrow icon