How to copy the selected tree node along with its children and paste the same
-
I have been searching the net for 2 months now looking for info on how to do this. Can anyone point me in the right direction? I have a vb.net program that used SendKeys to send ctrl+C and CTRL+V that was able to do this but I can't get that to go in VS2008 C#. tia rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
-
I have been searching the net for 2 months now looking for info on how to do this. Can anyone point me in the right direction? I have a vb.net program that used SendKeys to send ctrl+C and CTRL+V that was able to do this but I can't get that to go in VS2008 C#. tia rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
You're kidding right, 2 months wow! There are a number of options Context menu gives you right click on the node and deal with the menu option including ctrl C/V Trap the keydown method on the node for the ctrl C, grab the node and set a flag that a node is copied, trap the next key down for the ctrl V and add the copied (cloned) node to the current selected node.
Never underestimate the power of human stupidity RAH
-
You're kidding right, 2 months wow! There are a number of options Context menu gives you right click on the node and deal with the menu option including ctrl C/V Trap the keydown method on the node for the ctrl C, grab the node and set a flag that a node is copied, trap the next key down for the ctrl V and add the copied (cloned) node to the current selected node.
Never underestimate the power of human stupidity RAH
Yea really...I think if you look you will see some eariler posts going back a couple of months. I have tried that...all I seem to get is the highlighted node I get none of the child nodes. Originally this was a VB.net app done with VS2003 they used SendKeys CTRL+C and CTRL+V and it works fine. Now I am trying to upgrade to C# using VS2008 and the above no longer works (don't get the child nodes) Any other Ideas?? rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
-
Yea really...I think if you look you will see some eariler posts going back a couple of months. I have tried that...all I seem to get is the highlighted node I get none of the child nodes. Originally this was a VB.net app done with VS2003 they used SendKeys CTRL+C and CTRL+V and it works fine. Now I am trying to upgrade to C# using VS2008 and the above no longer works (don't get the child nodes) Any other Ideas?? rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
I guess you are copying the selected node and assuming the child nodes are in there - sounds like you need to get the whole structure of child nodes manually during the copy process. I also presume you are copying the selected node to the clipboard and then pasting from the clipboard and accepting those limitations. This is useful only if you are moving off the app/form/control where you are copying from (and thereby losing the original structure). If it is inside your app why not grab a placeholder on the copy event and when the paste is done go and get the entire structure from the original node.
Never underestimate the power of human stupidity RAH
-
I guess you are copying the selected node and assuming the child nodes are in there - sounds like you need to get the whole structure of child nodes manually during the copy process. I also presume you are copying the selected node to the clipboard and then pasting from the clipboard and accepting those limitations. This is useful only if you are moving off the app/form/control where you are copying from (and thereby losing the original structure). If it is inside your app why not grab a placeholder on the copy event and when the paste is done go and get the entire structure from the original node.
Never underestimate the power of human stupidity RAH
The way it worked in the old app was they were copying the selected node and pasting using the clipboard. This copies the selected node and all of its child nodes. (they were using the sendKeys CTRL+C and CTRL+V). The few examples I have found on the net were just the simple copy and paste of the selectedNode. I have also tried cloning but have not gotten that to work either. If you have an example or a link to a good example I would be most greatful. It seems like it should be a simple task but I guess if it was there would be some meaningful examples. tia rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...