Select a node after its created

  • Thread starter Thread starter John Rogers
  • Start date Start date
J

John Rogers

How do you keep the selection on a newly created treenode?

After I hit enter, the selection always go back to the first root
node.


TIA
 
Hi John,

How do you create the node? Is this a window or web application?
 
Hi,

I am creating it from a popup menu.

private void newCategoryToolStripMenuItem_Click(object sender,
EventArgs e)
{
TreeNode ParentNode = treeView1.Nodes.Add("New Category");
}


Thanks


Morten Wennevik said:
Hi John,

How do you create the node? Is this a window or web application?

--
Happy Coding!
Morten Wennevik [C# MVP]


John Rogers said:
How do you keep the selection on a newly created treenode?

After I hit enter, the selection always go back to the first root
node.


TIA
 
Thanks Marc,

I had tried the following but I couldn't get it to work.
treeView1.SelectedNode = e.Node;

I will see what messing it up.

Thanks again
 
No, no rebuilding. I am not too worried about it right now,
I was just wondering if I was on the right track. I will have
to put in on the todo list I guess :)

Appreciate the help.


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top