We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TreeViewADV Get Selected Node Value

Hi,

I am building a treevewadv in code behind using the following code

Private Sub DisplayFF(LoadOp As ServiceModel.DomainServices.Client.LoadOperation(Of FileAndFolderList))
        Dim iitem As TreeViewItemAdv
        Dim gid As Long = 0
        ListOffileandFolder = New List(Of FileAndFolderList)
        ListOffileandFolder = LoadOp.Entities.ToList
 
 
        Dim rooitemsonly = From c In ListOffileandFolder
                           Where c.RootItem = True
 
        tv_foldernadfiles.Items.Clear()
 
        For Each item In rooitemsonly
 
            iitem = New TreeViewItemAdv
 
            iitem.Name = item.ID
            iitem.Header = item.Name
 
            If item.Folder = True Then
                iitem.ExpandImageSource = GetImage("/LucidDocManager;component/Images/Folder-Open_vsmall.png")
                iitem.LeftImageSource = GetImage("/LucidDocManager;component/Images/Folder_vsmall.png")
            ElseIf item.Folder = False Then
                iitem.LeftImageSource = GetImage("/LucidDocManager;component/Images/Item-New_small.png")
            End If
 
            AddHandler iitem.GotFocus, AddressOf gtest
 
            tv_foldernadfiles.Items.Add(iitem)
        Next
 
        For Each item As TreeViewItemAdv In tv_foldernadfiles.Items
 
            gid = Val(item.Name)
 
            Dim checker = From c In ListOffileandFolder
                          Where c.parentID = gid
 
            For Each citem In checker
 
                iitem = New TreeViewItemAdv
                iitem.Name = citem.ID
                iitem.Header = citem.Name
 
              
                item.Items.Add(iitem)
 
            Next
        Next
 
    End Sub
The problem I have is I would like to be able to select a node and get it value.
With a regular Winforms Treeview Control this is simple but with the Silverlight control there seams to be no way of simpley clicking on a node and getting it value. 


1 Reply

MA Muthukumar A Syncfusion Team December 4, 2013 05:01 AM UTC

Hi Darren,

Sorry for the delay being caused.

We have created a sample based on your requirement stated in the DirectTrac.Please download the same from below location.

In this sample in selectednodechanged, We can get the Selected node details and also selected node's parent node details.

Please let us know if the sample fulfill your needs.If our understanding is differ from your requirement could you please provide as some more details about your requirement.

Thanks,
Muthukumar




Treeview_SelectedNodeDisplay_Sample_251cdbb0.zip

Loader.
Live Chat Icon For mobile
Up arrow icon