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
1270
Fire ValidateLabelEdit when new node text has not changed?
posted

Hi

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?

Thanks

James

  • 615
    posted

    Hello James,

    Do you have any more questions about this matter?

    Sincerely,
    Matteo
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

  • 69832
    Offline posted

    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.

  • 469350
    Verified Answer
    Offline posted

    Hi James,

    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.