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

Drag multiple nodes disabled when .EditStyle.AllowMoveY = false

If I set nodes .EditStyle.AllowMoveY = false then when multiple nodes are selected and dragged together the nodes will not move.

Is this intentional?

Is there a workaround?

Thanks


1 Reply

BM Bala Murugan A.S Syncfusion Team February 16, 2011 11:12 AM UTC

Hi John,

Thanks for using Syncfusion Products.

Since by default the nodes will not move when the EditStyle.AllowMoveX and EditStyle.AllowMoveX property of the nodes is set to false. If your intention is to move the multiple nodes. We suggest you to set these properties to true for all selected nodes and after the nodes are deselected you can to reset these properties. Please refer the below code snippet to achieve this.
[C#]
this.diagram1.MouseUp += new MouseEventHandler(diagram1_MouseUp);
this.diagram1.EventSink.NodeDeselected += new NodeSelectedEventHandler(EventSink_NodeDeselected);
void EventSink_NodeDeselected(NodeSelectedEventArgs evtArgs)
{
if(evtArgs.Node !=null)
foreach (Node node in ProtectedNodes)
{
node.EditStyle.AllowMoveX = false;
}
}

void diagram1_MouseUp(object sender, MouseEventArgs e)
{

if(this.diagram1.Controller.SelectionList.Count >1)
foreach (Node node in this.diagram1.View.SelectionList)
{
if (node.EditStyle.AllowMoveX == false)
{
ProtectedNodes.Add(node);

}
node.EditStyle.AllowMove = true;
}

}

We have created a simple sample to demonstrate this and the same can be downloaded from the below link.
DragMultipleNodes-1216786198.zip

Please let me know if you have any concerns.

Regards,
Bala Murugan A.S




Loader.
Live Chat Icon For mobile
Up arrow icon