473,418 Members | 2,019 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,418 software developers and data experts.

Treeview node set focus question

Kay
Hi all,

Can anyone tell me how do I set focus on a particular treenode at run time?
If you need to know what I'm try to do please read on ...

I have a treeview to represent a Country/Product scenario (i.e. a country,
as parent node, produce 1 to many product, as childnode). When the user
click on one of the node a group of textbox/combo box etc will be populated
and if btnSave is clicked data will then be updated and the treeview will be
reloaded.

I'm trying to "remember" the selected node , it could be parent or child
node, and after the treeview is refreshed I want to set focus to the that
node again. However I can't find the focus method for a node.....anyone
know how?

Thx!

Kay
Nov 23 '05 #1
3 10448
Hi,

You have to set the treeviews selectednode.

http://msdn.microsoft.com/library/de...dnodetopic.asp

Ken
---------------------
"Kay" <kk@micxsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,

Can anyone tell me how do I set focus on a particular treenode at run
time? If you need to know what I'm try to do please read on ...

I have a treeview to represent a Country/Product scenario (i.e. a country,
as parent node, produce 1 to many product, as childnode). When the user
click on one of the node a group of textbox/combo box etc will be
populated and if btnSave is clicked data will then be updated and the
treeview will be reloaded.

I'm trying to "remember" the selected node , it could be parent or child
node, and after the treeview is refreshed I want to set focus to the that
node again. However I can't find the focus method for a node.....anyone
know how?

Thx!

Kay

Nov 23 '05 #2
> Can anyone tell me how do I set focus on a particular treenode at run
time? If you need to know what I'm try to do please read on ...

I have a treeview to represent a Country/Product scenario (i.e. a country,
as parent node, produce 1 to many product, as childnode). When the user
click on one of the node a group of textbox/combo box etc will be
populated and if btnSave is clicked data will then be updated and the
treeview will be reloaded.

I'm trying to "remember" the selected node , it could be parent or child
node, and after the treeview is refreshed I want to set focus to the that
node again. However I can't find the focus method for a node.....anyone
know how?


Only TreeView has this method :
TreeView1.SelectedNode = YourRememberedNode

HTH, LinasB
Nov 23 '05 #3
Kay
That help! thanks !!

"Kay" <kk@micxsoft.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,

Can anyone tell me how do I set focus on a particular treenode at run
time? If you need to know what I'm try to do please read on ...

I have a treeview to represent a Country/Product scenario (i.e. a country,
as parent node, produce 1 to many product, as childnode). When the user
click on one of the node a group of textbox/combo box etc will be
populated and if btnSave is clicked data will then be updated and the
treeview will be reloaded.

I'm trying to "remember" the selected node , it could be parent or child
node, and after the treeview is refreshed I want to set focus to the that
node again. However I can't find the focus method for a node.....anyone
know how?

Thx!

Kay

Nov 23 '05 #4

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

Similar topics

0
by: hzgt9b | last post by:
Using visual studio .NET 2003, VB: I'm experiencing an issue with a TreeView object when it gets focus - the first root node in the tree always gets selected when the control gets focus - even if...
3
by: Dave | last post by:
I use the treeview to open a new form but the treeview reclaims focus after MouseUp. Any solutions to this problem?
1
by: Rasmus | last post by:
I need to grab focus to a specific node i my treeview when I click on my listbox. Here's the code that differs between the different event i the listBox: private void...
6
by: Tim | last post by:
Hi I have a form with a treeview on it. When I select a particular node it adds/shows a tab on the form. The treeview node remains selected as it should. The user can close the tab or remove the...
1
by: mongphong28 | last post by:
Hi, I'm using a treeview as a menu, and when the user clicks on a node I want the focus to set to a control (ie textbox) in a panel to the right. The problem I'm having is the focus will not...
2
by: Claus | last post by:
Hello, I have a long treeview with scrollbars. When I scroll down and press a treeview node, then the Load event fires and navigate in an iframe to another page. The problem is, that afterwards...
3
by: Michael_Burgess | last post by:
Hi there, I've looked around the different groups and still can't figure this out without resorting to scrappy code............ I want to programtically select and highlight a TreeView node,...
2
by: bg_ie | last post by:
Hi, I have a treeview where the user selects a node before editing it. The problem is that when the user clicks on the text box to edit the node, the treeview loses its focus and the node is no...
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
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.