Click here to Skip to main content
13,140,742 members (50,943 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a function where I get the parent and the childnode and i want each time the user clicked on the sitemap wich is composed by the following code:
Label_fatdata.Text += "<a id="fatdata" style="removed:pointer; margin-removed0px; text-transform:uppercase; font-size:10px; font-weight:500;" önclick="\"click(TreeView1," snode="" mode="hold" />

i want that redraws the main tree with the node (parent + child) that he gets from the backup tree. But so far I am having a lot of problems...first in if clause i need to verify the element 'a' with the backup tree.
void click(TreeView one, TreeView two)
            if (one.SelectedNode.ValuePath == two.SelectedNode.ValuePath)
                TreeNode parentdata = two.SelectedNode.Parent;
                TreeNodeCollection childdata = two.SelectedNode.ChildNodes;
Posted 8-Nov-12 6:24am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Instead of comparing the trees like in your code, an easier approach would be to :

1. Save the value the user selects to a session or viewstate variable

2. When redrawing the tree, add If condition to do what you want with the parent child nodes if the value of the node being redrawn = the saved variable. You can do this in the TreeView.TreeNodeDataBound event. simple.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100