We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TreeViewAdv node editing and BarItem''s Shortcut

Thread ID:





38099 Dec 6,2005 09:37 AM UTC Dec 7,2005 08:50 AM UTC WinForms 2
Tags: Tools
Asked On December 6, 2005 09:37 AM UTC

Hi all, I have a scenario where a BarItem''s Shortcut interferes with keys to be handled by the TextBox of a TreeViewAdv node editing. In my sample there is a TreeViewAdv with LabelEdit=true, and a toolbar containing a delete command (a BarItem with Shortcut=''Del''). See my attached sample: while a node in the tree is in editing mode, the Delete key is pressed on the keyboard. The click handler of the BarItem will be processed as first, then the delete is processed by the TextBox. My problem now ist, that in my real world scenario, the BarItem''s job is to delete the selected node; and this happens while the user hits the delete key simply to delete characters in the TextBox. Is there a problem with keyboard message routing? Shouldn''t the TextBox handle the delete key exclusively? Thanks in advance, Christian


Deepa TS [Syncfusion]
Replied On December 7, 2005 08:48 AM UTC

Hi Christian, Thanks for the test sample. I do see the above mentioned problem here. But this is a standard behavior and it is how the .NET MainMenu behaves too(please refer to Form2 in the modified sample attached below). The workaround here is to handle the TreeViewAdv''s BeforeEdit event, set the BarItem''s Shortcut to None, and listen to the node''s edit TextBox''s Leave event. Within this Leave event handler set the BarItem''s Shortcut back to Del. Please refer to the code snippet below that illustrates this : TextBox editbox; private void treeViewAdv1_BeforeEdit(object sender, Syncfusion.Windows.Forms.Tools.TreeNodeAdvBeforeEditEventArgs e) { this.editbox = e.TextBox; this.editbox.Leave +=new EventHandler(editbox_Leave); this.barItem1.Shortcut = Shortcut.None; } private void editbox_Leave (object sender, EventArgs args) { this.barItem1.Shortcut = Shortcut.Del; } Please refer to the attached sample and let me know if this works for you. We appreciate your interest in Syncfusion products. Regards, Deepa.T.S


Deepa TS [Syncfusion]
Replied On December 7, 2005 08:50 AM UTC

Hi Christian, You can also refer the KB article link given below for this issue. http://www.syncfusion.com/support/kb/tools/Default.aspx?ToDo=view&questId=252 Regards, Deepa.T.S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon