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
close icon

how to place node at specified coordinates

Hi,

Is there any way to set the location of node by specifying its coordinates (in descktop version of the diagram)? If there is no such posibility I would like to suggest to add it

Thanks a lot,
Bork


4 Replies

AD Administrator Syncfusion Team November 28, 2008 03:52 PM UTC

Hi Bork,

To place the nodes at some co ordinate point, use the following code snippet:

**********
Rectangle node, for example:
Rectangle rect = new Rectangle(0,0,100,150);

Set Coordinate location:
rect.PinPoint = new PointF(200,200);

**********

I am confident that this will resolve your query.

Happy Coding!

- Ajeet




RA Ron Alan Sawyer November 29, 2008 01:04 AM UTC

Note that the PinPointOffset is important as well. If it is set to 0,0 then

rect.PinPoint = new PointF(200,200);

Will set the upper left hand corner of your rect to 200,200.



MA MagicXtr December 1, 2008 08:16 AM UTC

Thanks a lot. I've found another method also: node.Translate(x, y);



AD Administrator Syncfusion Team December 1, 2008 02:29 PM UTC

Hi RAS,

The PinPointOffset is used to specify the "Centre of mass" for the selected Node, i.e. it defines the point keeping which constant, the rotate handle works.

Happy coding!

- Ajeet


>Note that the PinPointOffset is important as well. If it is set to 0,0 then

rect.PinPoint = new PointF(200,200);

Will set the upper left hand corner of your rect to 200,200.




Loader.
Live Chat Icon For mobile
Up arrow icon