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

New nodes are blank

2 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 16 Jun 2017, 07:25 PM

Hi there,

I'm trying to add nodes to a specific node in a previously databound radtreeview.  

When the page updates, the correct number of nodes are visible in the correct parent node, but they have no text.

 

                Dim current_version_node As RadTreeNode = rtvClientSpecs.FindNode(Function(x) x.FullPath = e.CommandArgument.ToString())
                If current_version_node.Nodes.Count = 0 Then

                    f = oclientContext.Web.GetFileByServerRelativeUrl("/" + e.CommandArgument.ToString())
                    oclientContext.Load(f.Versions)
                    oclientContext.ExecuteQuery()

                    For Each _version As FileVersion In f.Versions
                        If Not _version.IsCurrentVersion Then
                            Dim old_version_node As New RadTreeNode(e.CommandArgument.ToString() + "/" + String.Format("Version {0}", _version.VersionLabel))
                            old_version_node.Value = _version.VersionLabel
                            current_version_node.Nodes.Add(old_version_node)
                        End If
                    Next
                Else
                    current_version_node.Expanded = Not current_version_node.Expanded
                End If

2 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 19 Jun 2017, 01:49 PM

Some followup details:

When I step through the code, current_verison_node.Nodes contains the nodes to be added with all the correct values - including Text and Value.  It's just not displaying anything to the page except the empty nodes.

0
Richard
Top achievements
Rank 1
answered on 21 Jun 2017, 01:16 PM

Nevermind, thanks anyway (for nothing - 4 days and no response, really?).

I will still share my discovery in the hopes that it may help someone else.

The problem was that I was using a template and even though the node was added, it had no idea where to display the data since the template only had the parent nodes in mind. So, adding, and utilizing the existing controls to display the data worked out.   

e.g.

                            ' Display Version
                            Dim lblOldVersion As Label = DirectCast(old_version_node.FindControl("lblOldVersion"), Label)
                            lblOldVersion.Text = String.Format("Version {0}", f.Versions(_version).VersionLabel)

                            ' Display Last updated
                            Dim lblLastUpdated As Label = DirectCast(old_version_node.FindControl("lblLastUpdated"), Label)
                            lblLastUpdated.Text = "  Last Updated " & f.Versions(_version).Created

Tags
TreeView
Asked by
Richard
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or