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.
Unfortunately, activation email could not send to your email. Please try again.

TreeViewAdv node editing and BarItem''s Shortcut

Thread ID:

Created:

Updated:

Platform:

Replies:

38099 Dec 6,2005 04:37 AM Dec 7,2005 03:50 AM Windows Forms 2
loading
Tags: Tools
Christian
Asked On December 6, 2005 04:37 AM

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

TreeViewEditing.zip

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

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

NodeEditing.zip

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

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

CONFIRMATION

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.

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.

;