Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Root Node (Read 2323 times)
kdr35
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 12th, 2010
Root Node
Aug 16th, 2010 at 7:44am
Print Post  
I need to set one node as root before graph load so that node must be undeleted , How I can do undeleted one node.

I try to do in NodeDelete event as look node id but it doesnt work ı can control node id but I cant stop node delete event so node is deleted.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Root Node
Reply #1 - Aug 16th, 2010 at 8:20am
Print Post  
You can prevent the user from deleting a node by handling the NodeDeleting event. However, it is not raised when deleting nodes by code, or when loading files. You will have to create a new root node after calling LoadFromFile or ClearAll.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
kdr35
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 12th, 2010
Re: Root Node
Reply #2 - Aug 16th, 2010 at 8:29am
Print Post  
I dont need to delete node via code , i use only interface to delete node.
I tried to prevent in NodeDeleting Event ;

private void diagram1_NodeDeleting(object sender, NodeValidationEventArgs e)
{
if (e.Node.Id.ToString() == "0")// root node id
return;
}

But Node is deleted how i prevent to delete node in NodeDeleting Event .
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Root Node
Reply #3 - Aug 16th, 2010 at 9:12am
Print Post  
A 'return' is not enough. You should set the Cancel property of the event-args object.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
kdr35
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Aug 12th, 2010
Re: Root Node
Reply #4 - Aug 16th, 2010 at 10:16am
Print Post  
thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint