Articles in this section
Category / Section

Bring the nodes into the view without scrolling the diagram

1 min read

In diagram control, we have a built-in support to bring the node into the view without scrolling the diagram. The following methods are used to bring the nodes into the view without scrolling the diagram.

BringToView:

The Syncfusion.Windows.Forms.Diagram.Controller’s “BringToView()” method is used to bring the given bounding rectangle area as viewable in the diagram. where, we need to pass the bounds area as a parameter.

[C#]

diagram1.Controller.BringToView(diagram1.View.SelectionList[0].BoundingRectangle);

 

[VB]

diagram1.Controller.BringToView(diagram1.View.SelectionList(0).BoundingRectangle)

 

BringToCenter:

The Syncfusion.Windows.Forms.Diagram.Controller’s “BringToCenter()” method is used to bring the given bounding rectangle area as center of the diagram’ view. Here, we need to send the needed bounds area as a parameter. Please refer to the below code example.

[C#]

diagram1.Controller.BringToCenter(diagram1.View.SelectionList[0].BoundingRectangle);

 

[VB]

diagram1.Controller.BringToCenter(diagram1.View.SelectionList(0).BoundingRectangle)

 

ScrollToNode:

Also we can bring the particular/selected node into the view without scrolling the diagram by using Syncfusion.Windows.Forms.Diagram.View’s “ScrollToNode()”  method. Please refer to the below code example. 

[C#]

diagram1.View.ScrollToNode (diagram1.View.SelectionList[0]);

 

[VB]

diagram1.View.ScrollToNode (diagram1.View.SelectionList(0))

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied