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.
Syncfusion Feedback

How can I detect node is in visible diagram area?

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi...

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.

[C#]
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)
MessageBox.Show('Invisible');
else
MessageBox.Show('Visible');


Please let me know if you have any concerns.

Regards,
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.

Regards,
Pandi Murugan A


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.

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

;