Click here to Skip to main content
15,914,327 members
Home / Discussions / C#
   

C#

 
QuestionSingleton class in C# Pin
Shubhabrata Mohanty12-Dec-05 21:58
Shubhabrata Mohanty12-Dec-05 21:58 
AnswerRe: Singleton class in C# Pin
Rob Philpott13-Dec-05 6:40
Rob Philpott13-Dec-05 6:40 
QuestionC# Algorithm Pin
izakfick12-Dec-05 21:32
izakfick12-Dec-05 21:32 
GeneralRe: C# Algorithm Pin
J4amieC12-Dec-05 21:52
J4amieC12-Dec-05 21:52 
Questionpdf search Pin
TAREQ F ABUZUHRI12-Dec-05 21:20
TAREQ F ABUZUHRI12-Dec-05 21:20 
AnswerRe: pdf search Pin
Polis Pilavas12-Dec-05 23:10
Polis Pilavas12-Dec-05 23:10 
QuestionTreeview (Windows Application) Pin
Mahi.Ragava12-Dec-05 21:19
Mahi.Ragava12-Dec-05 21:19 
AnswerRe: Treeview (Windows Application) Pin
Curtis Schlak.13-Dec-05 3:20
Curtis Schlak.13-Dec-05 3:20 
Mahi.V.Ragava,

Let's assume that you have two TreeViews (treeView1 and treeView2) and a button (button1) to move TreeNodes from treeView1 to treeView2. Then, you can have the following event handler.
private void button1_Click(object sender, System.EventArgs e)
{
  if( treeView1.SelectedNode != null && treeView2.SelectedNode != null )
  {
    TreeNode n = treeView1.SelectedNode;
    treeView1.SelectedNode.Remove();
    treeView2.SelectedNode.Nodes.Add( n );
  }
}
When you get the reference to the selected node in the first tree, its Nodes collection already contains all subnodes. Therefore, when you add that TreeNode to the second tree, all the subnodes already exist and get put in automagically.

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
GeneralRe: Treeview (Windows Application) Pin
Mahi.Ragava13-Dec-05 17:08
Mahi.Ragava13-Dec-05 17:08 
GeneralRe: Treeview (Windows Application) Pin
Curtis Schlak.14-Dec-05 5:24
Curtis Schlak.14-Dec-05 5:24 
GeneralRe: Treeview (Windows Application) Pin
Mahi.Ragava14-Dec-05 17:40
Mahi.Ragava14-Dec-05 17:40 
GeneralRe: Treeview (Windows Application) Pin
Curtis Schlak.15-Dec-05 15:17
Curtis Schlak.15-Dec-05 15:17 
GeneralRe: Treeview (Windows Application) Pin
Mahi.Ragava15-Dec-05 17:55
Mahi.Ragava15-Dec-05 17:55 
GeneralRe: Treeview (Windows Application) Pin
Curtis Schlak.16-Dec-05 11:20
Curtis Schlak.16-Dec-05 11:20 
QuestionData chacing... Pin
ayuba asia12-Dec-05 21:17
ayuba asia12-Dec-05 21:17 
QuestionDataGrid row header text Pin
hellamasta12-Dec-05 21:16
hellamasta12-Dec-05 21:16 
QuestionOpen an excel document Pin
ckruger12-Dec-05 20:30
ckruger12-Dec-05 20:30 
AnswerRe: Open an excel document Pin
HakunaMatada12-Dec-05 20:38
HakunaMatada12-Dec-05 20:38 
GeneralRe: Open an excel document Pin
ckruger12-Dec-05 21:13
ckruger12-Dec-05 21:13 
GeneralRe: Open an excel document Pin
HakunaMatada12-Dec-05 23:49
HakunaMatada12-Dec-05 23:49 
AnswerRe: Open an excel document Pin
Polis Pilavas12-Dec-05 23:13
Polis Pilavas12-Dec-05 23:13 
QuestionHow to use PictureBox Events in Datagrid ??? Pin
Abubakarsb12-Dec-05 20:05
Abubakarsb12-Dec-05 20:05 
AnswerRe: How to use PictureBox Events in Datagrid ??? Pin
MarcelErz12-Dec-05 21:30
MarcelErz12-Dec-05 21:30 
GeneralRe: How to use PictureBox Events in Datagrid ??? Pin
Abubakarsb13-Dec-05 6:02
Abubakarsb13-Dec-05 6:02 
QuestionStoring text information in an image Pin
Maqsood Ahmed12-Dec-05 19:58
Maqsood Ahmed12-Dec-05 19:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.