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

Signature
Happy Coding!
Morten Wennevik [C# MVP]
> 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
John - 10 Mar 2008 13:17 GMT
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
> Hi John,
>
[quoted text clipped - 6 lines]
>>
>> TIA
Marc Gravell - 10 Mar 2008 13:39 GMT
All you need is:
treeView1.SelectedNode = newNode;
Marc
John - 10 Mar 2008 15:31 GMT
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
> All you need is:
> treeView1.SelectedNode = newNode;
>
> Marc
Marc Gravell - 10 Mar 2008 16:09 GMT
Are you rebuilding the node tree at all?
John - 10 Mar 2008 16:24 GMT
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
> Are you rebuilding the node tree at all?