When nodeClick parentNode has collapsed

7 posts, 0 answers
  1. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 14 Mar 2008 Link to this post

    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
  2. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 25 Mar 2008 Link to this post

    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
  5. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 25 Mar 2008 Link to this post

    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.
  6. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 27 Mar 2008 Link to this post

    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
  7. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 31 Mar 2008 Link to this post

    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
  8. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 02 Apr 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017