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

When nodeClick parentNode has collapsed

6 Answers 92 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Thencho
Top achievements
Rank 1
Thencho asked on 14 Mar 2008, 10:29 AM
Hello!!!

I have a RadTreeView that his nodes always are added dinamically, when the node has expanded I have using LoadOnDemand to search how many childnodes has, up here go well.

But when I click one node that have node.Postback to true (The node postback I will put if It has a navigateUrl), the node that has level 1 has collapsed, this only happen the first time that I do click in this nodo, if I do click to another node, it's happen the same, but only to her parentNode if it's don't expanded before.

I think maybe the treeview state doesn't save the first time that I do click, What can I do?

Thanks

6 Answers, 1 is accepted

Sort by
0
Thencho
Top achievements
Rank 1
answered on 25 Mar 2008, 12:00 PM
Hello again, 

I think maybe the treeview state doesn't save the first time that I do click, or the treeview ViewState it doesn't go well.

Is very important that I have solved this problem.

Bye.
0
Simon
Telerik team
answered on 25 Mar 2008, 01:18 PM
Hello Thencho,

Could you elaborate more information on the approach which you are trying to implement? When exactly the problem manifests itself?

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thencho
Top achievements
Rank 1
answered on 25 Mar 2008, 02:19 PM
First I have a list of node like this:

        -client1
        -client2
        -client3
        -client4
        -client5

When I open a client, whit load on demand I execute in node expanded a query that I cacth the projects for this client.

         -client1
        -client2
               -Projects
                    -Project1
                    -Project2
                    -Project3
                    -Project4
                    -Project5
                    -Project6
        -client3
        -client4
        -client5

When I click in Project1, the "projects" node collapse in postback.
0
Simon
Telerik team
answered on 27 Mar 2008, 04:04 PM
Hello Thencho,

RadTreeView should work as expected in the case you have described. However, without looking at your code, it would be difficult to find the cause of this erroneous behaviour.

Could you post the markup of the RadTreeView and any client/server code which works with it?

Thank you in advance.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thencho
Top achievements
Rank 1
answered on 31 Mar 2008, 08:15 AM
Hi

I have do a easy example with this problem, in aspx page I have this:
<asp:ScriptManager ID="ScriptManager2" runat="server">  
    </asp:ScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
   </telerik:RadAjaxManager> 
<telerik:RadTreeView ID="radTreeNav" runat="server" Skin="Default" LoadingMessage="Cargando ..." 
                                    LoadingStatusPosition="BeforeNodeText">  
                                    <CollapseAnimation Duration="100" Type="OutQuint" /> 
                                    <ExpandAnimation Duration="100" Type="OutQuart" /> 
                                </telerik:RadTreeView> 
        <asp:Label ID="Label1" runat="server"></asp:Label> 

And In the vb code:
 Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Not IsPostBack Then 
            Dim newNode As RadTreeNode  
            For x As Integer = 0 To 9  
                newNode = New RadTreeNode("Nodo" + x.ToString, x.ToString)  
                newNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
                radTreeNav.Nodes.Add(newNode)  
            Next 
        End If 
    End Sub 
 
    Protected Sub radTreeNav_NodeClick(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles radTreeNav.NodeClick  
        Label1.Text = e.Node.Text  
    End Sub 
 
    Private Sub radTreeNav_NodeExpand(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles radTreeNav.NodeExpand  
        Dim nodo As New RadTreeNode("Carpeta" + e.Node.Value)  
        nodo.ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
        e.Node.Nodes.Add(nodo)  
        nodo.Expanded = True 
        Dim newNode As RadTreeNode  
        For x As Integer = 0 To 9  
            newNode = New RadTreeNode("Nodo" + e.Node.Value + x.ToString, e.Node.Value + x.ToString)  
            newNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack  
            nodo.Nodes.Add(newNode)  
        Next 
    End Sub 

It happens the same problem.

Thanks
0
Simon
Telerik team
answered on 02 Apr 2008, 02:49 PM
Hi Thencho,

Thank you for providing the code.

I managed to reproduce the problem locally. It turned out that this is a bug with the current version of RadTreeView "Prometheus". The state of the first added parent node is not persisted.

One thing you could do is to set the ExpandMode of this particular node to ClientSide instead of ServerSideCallback, since its nodes would have been loaded already. This, however, will affect the node's state only visually.

I have logged this bug to our bug-tracking system. It should be fixed prior to our next official release.

Your Telerik points have been updated for the report.

We apologize for the caused inconvenience.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Thencho
Top achievements
Rank 1
Answers by
Thencho
Top achievements
Rank 1
Simon
Telerik team
Share this question
or