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

Expand and collapse controlnode

I have a user control that is hosted in a ControlNode.  On the control I have a button that when clicked I change the size of the user control to either expand or shrink the control's size.  I would like to have the Control Node's size to change with the controls node.

1 Reply

AA Amsath Ali M Syncfusion Team November 26, 2012 10:57 AM UTC

Hi Allen,

 

Thanks for your interest in Syncfusion products.

 

We suggest you to use the ControlNode.HostingControl’s ‘SizeChanged’ event to update the controlNode’s size when the HostingControl’s size changed. Please refer the below code snippet to achieve your requirement.

 

Here is the code:

[C#]

cnode.HostingControl.SizeChanged += new EventHandler(HostingControl_SizeChanged);

 

void HostingControl_SizeChanged(object sender, EventArgs e)

        {

            diagram1.Model.BeginUpdate();

            cnode.Size = cnode.HostingControl.Size;

            cnode.HostingControl.Location = new Point((int)cnode.BoundingRectangle.X, (int)cnode.BoundingRectangle.Y);           

            diagram1.UpdateView(cnode);

            diagram1.Model.EndUpdate();

        }      

 

Here is the sample:

https://s3.amazonaws.com/files2.syncfusion.com/dtSupport/DirectTrac/101068/F1058192110108194.zip

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M


Loader.
Live Chat Icon For mobile
Up arrow icon