I have a VB.NET application where I'm loading the UltraWinTree from the results of a query (but not using binding) and as I add the nodes to the tree I decide node by node whether to set the OverRide.AllowDelete = True or False.
I've run through the code and verified that the nodes that should have AllowDelete = ture are set properly and I've debugged the code in my AfterSelect Event on the Node to verify it as well. But after a node is selected and I press the Delete Key the BeforeDelete event doesn't fire.
Thanks,
JCIrwin
Hi Jamie,
Thank you for providing us with your solution to this issue. Please feel free to let us know if anything else comes up.
I was able to figure this out by walking through my code and explaining it to a co-worker.
What we found is that when I load the data from the results of an SQL query I was setting the .AllowDelete = true where I should have been setting it to DefaultableBoolean.True.
All is well now.
Mike,
I was able to see enough of your example to do my own in VB.NET, and sure enough the Delete works as expected. I must have something else wrong somewhere else. I have code in the AfterSelect event and was able to verify that the AllowDelete property is set properly on the nodes I wish to Delete.
I also have Drag and Drop implemented on this same TreeView such that I can "copy" an existing node to a new Parent and when I do that, those nodes ARE "deletable" and the BeforeDelete does fire.
also I'm using a Custom Control that inherits from the UltraTreeNode, so I suppose it is possible that is causing some sort of problem. If I can update my sample to use the other TreeNode object I'll see if that reproduces the issue and I'll post that sample back to this thread.
I apologize that I didn't provide this information in my earlier post.
Thanks for the sample Mike, but it's in C# and I'm working in VB.NET.
While I'm confident I could take the time to translate the C# to VB I don't see why I should have to bother to do that when I clearly stated that I am working n VB.NET.
I did open your solution but got errors and was not able to open the design view of your form, I was hoping to see if you had set any properties that I may have forgotten to set.
I'll try creating a sample, but that will take me a little while.
Thanks anyway,
I tried to build a sample to reproduce this, but was unsuccessful. In my sample, the BeforeDelete event always fired correctly. Are you able to modify my sample or build a new one that reproduces it?
Please let me know if you have any questions.