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.
Unfortunately, activation email could not send to your email. Please try again.

TreeViewADV Get Selected Node Value

Thread ID:

Created:

Updated:

Platform:

Replies:

114641 Nov 28,2013 11:55 AM Dec 4,2013 12:01 AM Silverlight 1
loading
Tags: Tools
Darren Hunnter
Asked On November 28, 2013 11:55 AM

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. 


Muthukumar A [Syncfusion]
Replied On December 4, 2013 12:01 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;