My users can add new nodes to a tree, and I add new nodes with a default name "New Node" and put the node in edit mode so the user is urged to rename the new node. I use the ValidateLabelEdit event to ensure the name is unique in the tree.
However, if the user adds a new user but doesn't change the name, the new node in the tree is called "New Node". Which means when a second new node is added and the user doesn't change the name, a duplicate exists.
The problem I have is that the ValidateLabelEdit event doesn't fire. How can I make the ValidateLabelEdit event fire when the user hasn't modified the tree node name?
I'm not sure I understand the issue, but it sounds like the problem is that you are using a default name of "New Node" without first checking to see if that name already exists in the tree.
What we typically do for cases like this is append a number to the name. So you could check to see if "New Node" exists in the tree, and if so, use "New Node 1", "New Node 2", etc.
ValidateLabelEdit does not fire when the text in the editor has not changed since it first entered edit mode. This is by design, based on the premise that if nothing has changed there is nothing to validate. The AfterLabelEdit event, however, fires regardless of whether the text in the editor has changed.
Do you have any more questions about this matter?
Sincerely,MatteoDeveloper Support EngineerInfragisticswww.infragistics.com/support
No, all done.