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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Delimit space into the DiagramWebControl for some Rectangles

Thread ID:





79927 Mar 4,2009 01:10 PM UTC Mar 12,2009 06:21 AM UTC ASP.NET Web Forms (Classic) 1
Tags: DiagramWebControl
Asked On March 4, 2009 01:10 PM UTC

First at all, thanks for your quick answear to my last post.

I would like to know if it is posible to create one or more small rectangles into a big rectangle and let the user to move the smallers into the big one, but not to allowing him to move them out of the big one.
What I need is to use a big rectangle to delimited a space into the DiagramWebControl, but this limit should be resized by the user.


Administrator [Syncfusion]
Replied On March 12, 2009 06:21 AM UTC

Hi Rod,
Sorry for the delay in response. Please check the code snippet given below which uses the grouping concept to achieve you requirement and it does not allow the node in a group to be placed away from its bounds.

private RectangleF groupBound;
private bool flagOnce;
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack)
flagOnce = true;
this.DiagramWebControl1.Model.EventSink.PinPointChanged += new PinPointChangedEventHandler(EventSink_PinPointChanged);
Group boundGroup = new Group();
for (int nodeCount = 1; nodeCount < 5; nodeCount++)
sRectange rectangle = new sRectange(100, nodeCount * 50, 100, 25);
rectangle.Name = "Node" + nodeCount.ToString();
groupBound = boundGroup.BoundingRectangle;

void EventSink_PinPointChanged(PinPointChangedEventArgs evtArgs)
Node node = (Node)evtArgs.NodeAffected;
if (!(groupBound.IntersectsWith(node.BoundingRectangle)))
if (flagOnce)
flagOnce = false;
node.PinPoint = new PointF(node.PinPoint.X - evtArgs.Offset.Width, node.PinPoint.Y - evtArgs.Offset.Height);


Please let me know if there is any concerns in this regard.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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