Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Remove the children items of a ContainerNode (Read 1258 times)
sweetdeath
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 18
Joined: Mar 16th, 2011
Remove the children items of a ContainerNode
Mar 21st, 2011 at 12:10pm
Print Post  
Hi,Stoyan.Suppose I have several ContainerNodes and every Container also have several children items.How can I remove all the children items
form the selected Container when I am triggering the "ContainerFolded" event of the Container?
Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Remove the children items of a ContainerNode
Reply #1 - Mar 21st, 2011 at 1:19pm
Print Post  
Hi,

Try this:
Code
Select All
private void diagram_ContainerFolded(object sender, NodeEventArgs e)
{
	ContainerNode container = (ContainerNode)e.Node;
	List<DiagramNode> children = new List<DiagramNode>();
	foreach (DiagramNode node in container.SubordinateGroup.AttachedNodes)
		children.Add(node);
	foreach (DiagramNode node in children)
	{
		container.Remove(node);
		node.Visible = true;
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint