473,413 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Select a node after its created

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
Mar 9 '08 #1
6 1161
Hi John,

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

--
Happy Coding!
Morten Wennevik [C# MVP]
"John Rogers" wrote:
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
Mar 10 '08 #2
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 [C# MVP]" <Mo************@hotmail.comwrote in message
news:BD**********************************@microsof t.com...
Hi John,

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

--
Happy Coding!
Morten Wennevik [C# MVP]
"John Rogers" wrote:
>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

Mar 10 '08 #3
All you need is:
treeView1.SelectedNode = newNode;

Marc
Mar 10 '08 #4
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

"Marc Gravell" <ma**********@gmail.comwrote in message
news:f2**********************************@m36g2000 hse.googlegroups.com...
All you need is:
treeView1.SelectedNode = newNode;

Marc

Mar 10 '08 #5
Are you rebuilding the node tree at all?
Mar 10 '08 #6
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
"Marc Gravell" <ma**********@gmail.comwrote in message
news:76**********************************@h25g2000 hsf.googlegroups.com...
Are you rebuilding the node tree at all?

Mar 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: martin.tschofen | last post by:
How do I select only the first node from a for-each loop that contains a the element "photo". the following xsl finds all "art" elements that have a "photo" element. The problem is that I only...
1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
13
by: André Nogueira | last post by:
Hi there. I know you can view a node's fullpath property, but is it posible to select a node using its path? Like, tell the treeview that the node that should be selected is the node with the...
6
by: Adam Tilghman | last post by:
Hi all, I have found that IE doesn't seem to respect the <SELECT> "multiple" attribute when set using DOM methods, although the attribute/property seems to exist and is updated properly. Those...
4
by: praveen | last post by:
I have a form with treeview control loaded from xml document,text box, two buttons named "Find" and "FindNext" and my treeview which looks like below. Details |__ policy status |__ created by...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
3
by: trpost | last post by:
I want to be able to select a word when I highlight over any part of the word. When I say select the word, I want it to be highlighted as if I left clicked my mouse and dragged the cursor along the...
4
by: Patrick Nolan | last post by:
I am using javascript to manipulate optgroups in select elements. When the results are displayed in Firefox 2.0 there is an annoying blank line at the top of the multi-line select box. This...
5
by: =?Utf-8?B?dmlubw==?= | last post by:
Hello I have created a TreeView and i wish to select a node into it and then expand the selected node. Is someone has an idea ? Thanks
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.