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

Move Node

if to change Node.OffsetX and Node.OffsetY from code, there is no changes on the screen till the first interaction with the diagram
Which method should be executed to update rendering manually?

Also i have prompt to use Position property for moving nodes, but if I create 10 nodes with diffrent positions they are shown in top left corner

Could you provide code for correct moving node (am I do not want to reset the whole diagramModel)


8 Replies

NA Nikhil A Syncfusion Team October 9, 2009 09:44 AM UTC

Hi Pavel,

Thanks for your interest in Syncfusion products.

Once the new offset positions have been assigned, you need to call the InvalidateMeasure() of the page as follows:

nodeobj.OffsetX=50;
nodeobj.OffsetY=100;
DiagramPage page = new DiagramPage();
page=diagramView.Page as DiagramPage;
page.InvalidateMeasure();

This will move the node to the specified location. We suggest you always use the Offset properties only for positioning the node. The Position property will not place the nodes appropriate as it is used internally for other purposes.

Please let us know if there are any concerns.

Regards,
Nikhil


AD Administrator Syncfusion Team November 1, 2009 04:46 PM UTC

Is there a way to restrict a node from moving on X or Y axis.


AD Administrator Syncfusion Team November 1, 2009 04:53 PM UTC

Also talking about moving, is there an event that I can use to see if a node is moving?
I did found for starting and ending the moving operation (NodeDragStart and NodeDragEnd).
I need something like NodeDragging, which will be lunched when the node position is changed.


NA Nikhil A Syncfusion Team November 2, 2009 05:29 AM UTC

Hi,

For the first question about restricting node move, we would like you to know that we have a property called AllowMove for Nodes which when set to false, will prevent the node from moving . However we currently do not support restricting the Node from moving in any one axis alone.

With respect to the second query about NodeDragging event, we currently do not have such an event . However we will provide this event in our future releases.

Please let me know if there are any concerns.

Regards,
Nikhil
Syncfusion WPF Team


AD Administrator Syncfusion Team November 12, 2009 02:13 PM UTC

As I see from one of the post, for updating graphically the node position we have to call

page.InvalidateMeasure();

This method makes the diagram to refresh and in case the diagram has a scroll bar, the page will go in the top.
Is there a way to avoid this?

Thank you.


NA Nikhil A Syncfusion Team November 13, 2009 11:10 AM UTC

Hi Dreic,

For updating the node position you can call the page.InvalidateArrange() method.

This will prevent the page to scroll up.

Regards,
Nikhil,
Syncfusion WPF team


AD Administrator Syncfusion Team November 16, 2009 05:15 PM UTC

Hello,

I hope you can help me with the following problem.

I need for my project the two events for a node (PositionChanging and PositionChanged). To implement these, I had to disable the automatic dragging of the node.
Next, I have override the OffsetX and OffsetY properties and added the events in these two properties.
Next I have implemented my own dragging operations.

Everithing work good but the problem that i have encountered is that when I have to scroll to some objects and move them, the base.OffsetX and base.OffsetY properties seem to not work correct, because I am assigning a value but they retain a different value. I think I have to add an offset for the scroll on X and Y, but I cannot seem to find them.
If not, what do you think the problem is?

Thank you.


NA Nikhil A Syncfusion Team November 17, 2009 10:59 AM UTC

Hi dreic,

Yes, while scrolling we take the amount of area scrolled and modify the offsets to display proper values. This is done internally using the view's scrollbar. However the scrollbar is internal. But we do have events in place to detect node drag;

NodeDragStart: fires when the node drag operation is started.

NodeDragEnd: fires when the drag operation is complete.

We will be implementing NodeDragging event , if that helps you solve your problem.

Please let us know if there are any concerns.

Regards,
Nikhil

Loader.
Live Chat Icon For mobile
Up arrow icon