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. Image for the cookie policy date

+/- keys in TreeViewAdv

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

5 Replies

AD Administrator Syncfusion Team April 15, 2004 11:15 AM

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.


AD Administrator Syncfusion Team April 15, 2004 12:03 PM

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


AD Administrator Syncfusion Team April 16, 2004 02:07 PM

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.


AD Administrator Syncfusion Team April 19, 2004 08:42 AM

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


AD Administrator Syncfusion Team April 19, 2004 08:28 PM

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.

Loader.
Live Chat Icon For mobile
Up arrow icon