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
close icon

grouping nodes

I can see in the Symbol Factory example how to group nodes together and then add the group to the diagram.
Is there a way to programmatically group a node to another node already in the diagram?
I cannot access the downloaded help/case info until we upgrade to 2010 Sp1 which will not happen for weeks.
Thanks for your help.
Gary


1 Reply

AA Amsath Ali M Syncfusion Team February 23, 2012 01:55 PM UTC

Hi Gary,

Thanks for using Syncfusion products.

We suggest you to use the diagram’s ‘Group’ class to group the nodes programmatically. Please refer the below code snippet to achieve your requirement.

Here is the code:
[C#]
Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 50, 100, 70);
rect.EnableCentralPort = false;
rect.FillStyle.Color = Color.SkyBlue;
rect.FillStyle.Type = FillStyleType.LinearGradient;


Syncfusion.Windows.Forms.Diagram.Ellipse ellp = new Syncfusion.Windows.Forms.Diagram.Ellipse(30, 10, 40, 40);
ellp.EnableCentralPort = false;
ellp.FillStyle.Color = Color.Lime;
ellp.FillStyle.Type = FillStyleType.LinearGradient;

//Grouping Nodes
Group grp = new Group();
grp.AppendChild(rect);
grp.AppendChild(ellp);
diagram1.Model.AppendChild(grp);
Here is the sample:
F102702-1784928933.zip

Please let us know if you have any queries.

Regards,
Amsath Ali. M



Loader.
Live Chat Icon For mobile
Up arrow icon