473,320 Members | 1,870 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,320 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 2394
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: 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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.