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.
Syncfusion Feedback

+/- keys in TreeViewAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

12923 Apr 15,2004 09:34 AM UTC Apr 20,2004 12:28 AM UTC Windows Forms 5
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 15, 2004 09:34 AM UTC

Hi, Do we have to implement the handling for the +/- keys in TreeViewAdv ourself to expand/collaps the nodes or is there any property to set? Regards, Thomas

Administrator [Syncfusion]
Replied On April 15, 2004 03:15 PM UTC

Hi Thomas, You could use the TreeViewAdv''s Expand, ExpandAll, Collapse, and CollapseAll methods for this purpose. Please let me know if you need any other information. Thanka for considering Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 15, 2004 04:03 PM UTC

Hi Guru In compare to the treeview functionallity in Microsoft products, this should be included in the TreeViewAdv. The arrow keys are supported and it would be a real gain if you would handle also the +/-/* hotkey functionnality. Regards Thomas

Administrator [Syncfusion]
Replied On April 16, 2004 06:07 PM UTC

Hi Thomas, You could implement such HotKey features by deriving from the TreeViewAdv control and overriding its ProcessCmdKey method as shown in the code below : public class CustomTreeViewAdv : TreeViewAdv { public CustomTreeViewAdv () : base() { } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { // collapse this node and all child nodes under it if (keyData == Keys.Add) { foreach(TreeNodeAdv tna in this.SelectedNodes) { tna.CollapseAll(); } } // expand this node else if (keyData == Keys.Subtract) { foreach(TreeNodeAdv tna in this.SelectedNodes) { tna.Expand(); } } return base.ProcessCmdKey(ref msg,keyData); } } Also, provide us more information on what you expect the ''+'', ''-'' and ''*'' HotKeys to do. We appreciate your feedback, and thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 19, 2004 12:42 PM UTC

Hi Guru I''m modifying the code a little bit: public class CustomTreeViewAdv : TreeViewAdv { public CustomTreeViewAdv () : base() { } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { // expand this node if (keyData == Keys.Add) { foreach(TreeNodeAdv tna in this.SelectedNodes) { tna.Expand(); } } // expand all nodes if (keyData == Keys.Multiply) { foreach(TreeNodeAdv tna in this.SelectedNodes) { tna.ExpandAll(); } } // collapse this node and all child nodes under it else if (keyData == Keys.Subtract) { foreach(TreeNodeAdv tna in this.SelectedNodes) { tna.CollapseAll(); } } return base.ProcessCmdKey(ref msg,keyData); } } In this case we have the same nrealy functionallity like in Explorer or Outlook. The only difference is that there is not a Collapse() method in your TreeViewAdv. In comparsion to the Windows Explorer, the "-" will only collapse the selected node, the sub nodes are still expanded. Regards Thomas

Administrator [Syncfusion]
Replied On April 20, 2004 12:28 AM UTC

Hi Thomas, Thanks for the update. I have conveyed your request for a Collapse method in the TreeViewAdv to collapse one level at a time. I will update you with more information as soon as they get back to me. We appreciate your cooperation, and thanks for considering Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

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.

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

;