473,230 Members | 1,804 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,230 software developers and data experts.

wrong TreeView node selected

rfm
I have a TreeView with 1 expanded top node, it has several childnodes
(call it row A), which have childs of their own.

The top node is selected correctly and all childnodes from the row A
nodes are selected correctly.

But if I select (with the mouse) one of the nodes in row A it always
displays the first node in row A as selected.

Is this a bug in treeview or something, cause I can't think of any
reason it does this.

--

Jan 24 '07 #1
2 2388
Hi

http://munnacs.blogspot.com/2006/11/...ry-useful.html

This might help you

Thanks.
Masudur
www.kaz.com.bd
http://munnacs.blogspot.com
On Jan 24, 4:34 pm, "rfm" <i...@home.nlwrote:
I have a TreeView with 1 expanded top node, it has several childnodes
(call it row A), which have childs of their own.

The top node is selected correctly and all childnodes from the row A
nodes are selected correctly.

But if I select (with the mouse) one of the nodes in row A it always
displays the first node in row A as selected.

Is this a bug in treeview or something, cause I can't think of any
reason it does this.

--
Jan 24 '07 #2
rfm
Thanx, now I at least know why it doesn't work, apparently value needs
to be unique.
Problem is node.value needs to be the same for some nodes in my app.
So I found another solution.

Treeview_load is called before TreeView1_SelectedNodeChanged and
contains the correct selected node.
example:

public TreeNode selectedNode;

protected void TreeView1_SelectedNodeChanged(object sender,
EventArgs e)
{
if (selectedNode != null)
{
TreeView1.SelectedNode.Selected = false;
selectedNode.Select();
}
....
}

protected void TreeView1_Load(object sender, EventArgs e)
{
if (TreeView1.SelectedNode != null)
{
selectedNode = TreeView1.SelectedNode;
}
}
Masudur wrote:
Hi

http://munnacs.blogspot.com/2006/11/...trol-very-usef
ul.html

This might help you

Thanks.
Masudur
www.kaz.com.bd
http://munnacs.blogspot.com
On Jan 24, 4:34 pm, "rfm" <i...@home.nlwrote:
I have a TreeView with 1 expanded top node, it has several
childnodes (call it row A), which have childs of their own.

The top node is selected correctly and all childnodes from the row A
nodes are selected correctly.

But if I select (with the mouse) one of the nodes in row A it always
displays the first node in row A as selected.

Is this a bug in treeview or something, cause I can't think of any
reason it does this.

--


--

Jan 24 '07 #3

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

Similar topics

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...
7
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
3
by: Shawn | last post by:
Hi. I'm working with the TreeView control in my ASP.NET 1.1 application. I have a problem I haven't been able to figure out. When I click on a node (not expand), whether it's a parent node, a...
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...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
by: =?Utf-8?B?Rmx5Z3V5?= | last post by:
I have a TreeView with so many nodes that it requires scroll bars. When the user selects a node the screen is refreshed and the selected node is no longer visible. The TreeView is opened to the...
3
by: dutsnekcirf | last post by:
I have a treeview control on a custom task pane in Excel. I've enable the ability to use Drag & Drop (by following this how-to) on the treeview to change the order of the nodes. The problem though...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.