Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
BeforeDelete event is not being raised on UltraTree control when nodes are deleted. Is this a bug, am I doing something wrong or misunderstanding what this event represents?
posted

 

BeforeDelete event is not being raised on UltraTree control when nodes are deleted. Is this a bug, am I doing something wrong or misunderstanding what this event represents?

To reproduce, place an UltraTree control and a button onto a new Form in a new Windows Forms project. Replace the designer code with this below. Press the button to delete a node and notice that the MessageBox does not appear. Am I missing a setting or something for this event to be enabled or is this a bug?

 

 

 

 

 

 

 

 

 

 

 

public partial class Form1 : Form

{

 

 

public

Form1()

{

InitializeComponent();

 

 

this.ultraTree1.BeforeDelete += new Infragistics.Win.UltraWinTree.BeforeNodeDeleteChangedEventHandler

(ultraTree1_BeforeDelete);

 

 

UltraTreeNode node = this

.ultraTree1.Nodes.Add();

node.Text =

"Parent";

node.Nodes.Add(

"c1", "Child1");

node.Nodes.Add("c2", "Child2");

}

 

 

void ultraTree1_BeforeDelete(object sender, Infragistics.Win.UltraWinTree.BeforeNodesDeletedEventArgs

e)

{

 

 

 

MessageBox.Show(string.Format("Deleting {0}", e.Nodes.Length.ToString()));

}

 

 

 

 

private void button1_Click(object sender, EventArgs e)

{

ultraTree1.Nodes[0].Nodes.RemoveAt(0);

}

Parents
No Data
Reply
  • 5389
    posted

    pnewman,

    The UltraTree's BeforeDelete event only fires when an UltraTreeNode is deleted via the UI; it does not fire when an UltraTreeNode is removed programatically.

    ~Kim~

Children