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.