Moving a group to a position

Hello,

I was trying to move a Group around my Diagram programmatically by using SelectedGroup.Move(Point), but the new position where the Group went is not excatly same as the destination in my program. For example,
myDiagram.SelectedGroup.Move(
new Point(
myDiagram.SelectedGroup.Location.X,
double.Parse(((TextBox)sender).Text)),
false
);
where the user can give a new Y position in the TextBox. Let's say the user input "300" as Y cor and the original X is "200", after method Move() was excuted, I got the Group with new position like X="202", where Y="315". So it's weird that the result had big gap.
Could you investigate mu situation and some suggestion? I didn't set something like snap to grid BTW.
Thanks
Henry G

Does your group’s DataTemplate use a GroupPanel? If so, you must set the go:Node.LocationElementName to refer to that GroupPanel.

The reason is that the Location of the group has to be the Location of the GroupPanel.

But the Position of the group, i.e. the top-left corner of the group’s Bounds, typically has smaller X and Y values than the Location. This is because of any border or any other elements such as text that surround or are positioned above the GroupPanel.

Your problem is because you are confusing Location with Position. The Node.Move method takes a new position, not a new location. Try replacing “myDiagram.SelectedGroup.Location.X” with “myDiagram.SelectedGroup.Position.X” in your code.

It sounds like I really confused those concepts and practically I changed my code according to your suggestion, and I got it working properly. Thanks a lot!