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

Retrieve ParentID Node of Selected Node

4 Answers 54 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Luca Fumagalli
Top achievements
Rank 1
Luca Fumagalli asked on 25 Aug 2009, 09:34 AM
Dear Sirs,
i have a problem: i need to retrieve ParentID Node of Selected Node, how can i do that?
If possible in VB language
Many thanks

Luca

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Aug 2009, 10:56 AM
Hi Luca,

I hope you are trying to access the ID of the Parent node of a clicked node. If so give a try with the following approach and see whether it helps.

VB:
 
 
 
    Protected Sub RadTreeView1_NodeClick(ByVal sender As ObjectByVal e As RadTreeNodeEventArgs) 
        If e.Node.ParentNode IsNot Nothing Then 
            Dim parentNodeID As String = e.Node.ParentNode.ID.ToString() 
        End If 
    End Sub 
 
 


Shinu
0
Luca Fumagalli
Top achievements
Rank 1
answered on 25 Aug 2009, 12:54 PM
Many thanks for your answer.
Another question: if I want to retrieve the ID of the selected node, which instruction I have to use?

Thanks

Luca
0
Princy
Top achievements
Rank 2
answered on 25 Aug 2009, 01:54 PM
Hello Luca,

You just have to use the following code:
Vb:
 Protected Sub RadTreeView1_NodeClick(ByVal sender As ObjectByVal e As RadTreeNodeEventArgs)  
         
     Dim nodeID As String = e.Node.ID.ToString()  
         
 End Sub  

Thanks
Princy.
0
Luca Fumagalli
Top achievements
Rank 1
answered on 25 Aug 2009, 02:15 PM
opsss :)
thanks
Tags
TreeView
Asked by
Luca Fumagalli
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Luca Fumagalli
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or