This is a migrated thread and some comments may be shown as answers.

About get_parent()

1 Answer 86 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nick Wu
Top achievements
Rank 1
Nick Wu asked on 20 May 2010, 01:14 PM
I test the example code of "Getting the Nodes Full Path" , but it can't work well.

so I mark break point , and debug it. Then I see , get_parent() return the control which contain the tree, because I put the tree in the RadPane. 

 So  I Have no choice but using the level . When I use get_level() , it returns "5" for root node . For my aspx page layout, it maybe this.

 Splitter          <----- level 0
     radpane               <-----level 1
         Splitter                       <-----level 2
            radpane                         <-----level 3
                 treeview                              <-----level  4
                      (root  node )             <-----level 5
 

To user , it's so strange that the method  of TreeNode returns  .

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 25 May 2010, 12:24 PM
Hello Nick Wu,

I couldn't reproduce the issue. I've recreated the scenario provided by you. Here is the markup and the structure exactly as given:
<telerik:RadSplitter runat="server" ID="RadSplitter1">
    <telerik:RadPane runat="server" ID="RadPane1">
        <telerik:RadSplitter runat="server" ID="RadSplitter2">
            <telerik:RadPane runat="server" ID="RadPane2">
                <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicked="onClientNodeClicked">
                    <Nodes>
                        <telerik:RadTreeNode Text="Node1" />
                    </Nodes>
                </telerik:RadTreeView>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
</telerik:RadSplitter>
Here is the handler for the OnClientNodeClicked event:
function onClientNodeClicked(sender, args)
{
    alert(args.get_node().get_level());
}

And when I ran that in the browser and clicked on the node it alerted me with "0".

Please, try out my example.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Nick Wu
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or