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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I detect node is in visible diagram area?

Thread ID:





98642 Mar 15,2011 01:08 AM UTC Mar 22,2011 09:45 AM UTC WinForms 3
Tags: Diagram
Youngjin Kim
Asked On March 15, 2011 01:08 AM UTC


I'd like to scroll diagram using View.ScrollToNode(Node) method only when the node is out of the visible area. How can I detect if the node is out of visible diagram area?

Thanks in advance.

Pandi Murugan A [Syncfusion]
Replied On March 16, 2011 12:31 PM UTC

Hi Youngjin,

Thanks for using Syncfusion products.

We suggest you to use Diagram's Origin, ClientRectangle and Node's Bounds to achieve your requirement. Please refer the below code snippet.

Node node = this.diagram1.Controller.SelectionList[0];
if (node.BoundingRectangle.Right < diagram1.Origin.X || node.BoundingRectangle.Bottom < diagram1.Origin.Y || (node.BoundingRectangle.Left - diagram1.Origin.X) > diagram1.ClientRectangle.Width || (node.BoundingRectangle.Bottom - diagram1.Origin.Y) > diagram1.ClientRectangle.Height)

Please let me know if you have any concerns.

Pandi Murugan A

Youngjin Kim
Replied On March 21, 2011 06:56 AM UTC

Thanks a lot.
It works fine for me.

Pandi Murugan A [Syncfusion]
Replied On March 22, 2011 09:45 AM UTC

Hi Youngjin,

Thanks for the update.

Please let me know if you have any other concerns.

Pandi Murugan A


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon