C1Treeview.EditTemplate issue

Posted by: haley.fang on 6 August 2024, 5:51 am EST

  • Posted 6 August 2024, 5:51 am EST

    In my C1TreeView.EditTemplate, there is a Textbox. When I’m editing in the textbox on the tree node, if I input ‘Right Arrow’, or ‘Left Arrow’ or ‘Up Arrow’ or ‘Down Arrow’ in the keyboard, textbox will automatically lost focus and navigate to the next tree node. I wouldn’t like to have this. Because the reason why I input left arrow key in the keyboard is because there is something wrong about what I typed. I would like to modify it by using left arrow key to navigate to the wrong place rather than go to next tree node. However, it forced to go to next node.

    Thanks for looking into this issue.

  • Posted 7 August 2024, 6:47 am EST

    Hi Haley,

    We could see the behavior you mentioned. To fix this, you can handle the PreviewKeyDown event of the C1TreeView and set the e.Handled to true for arrow keys. Then, you can manually update the TextBox’s cursor position as per the pressed arrow key.

    Please see the attached sample project for reference - TreeViewEditNode.zip

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels