Load on demand and add node

4 posts, 0 answers
  1. Blair
    Blair avatar
    22 posts
    Member since:
    Jun 2012

    Posted 20 Jun 2012 Link to this post

    Hello,

     

    I’ve implemented the RadTreeView with load on demand using ExpandMode = ServerSideCallback. I’ve also implemented context menus to allow users to add nodes dynamically. The problem I’m having is figuring out how to render the tree and expand to the newly added node. Since the load on demand only loads the top level nodes, the added node won’t be visible on postback in cases where the new node is a couple of levels deep.

     

    I would appreciate any suggestions.

     

    Also, I’ve implemented drag and drop which is going to be a problem too. So any suggestion for that would be helpful too.

     

    Blair

  2. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 25 Jun 2012 Link to this post

    Hello Blair,

    The load on demand mechanism doesn't have a restriction on the number of node levels you can load in a single web service call. For instance you can do the following:
    void RadTreeView1_NodeExpand(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
    {
        RadTreeNode node = new RadTreeNode("child");
        RadTreeNode child = new RadTreeNode("grandchild");
        node.Nodes.Add(child);
        node.Expanded = true;
        e.Node.Nodes.Add(node);
    }

     
    All the best,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Blair
    Blair avatar
    22 posts
    Member since:
    Jun 2012

    Posted 25 Jun 2012 Link to this post

    Bozhidar,

    Thanks for the reply. I've managed to get past that point. Thanks anyway. I have another problem related to the ServerSideCallback load on demand.

    I'm trying to implement tree navigation outside the tree using buttons like Previous and Next. When I get to a node that requires expanding I'm calling expand() client side. I see the spinner next to the node, but it never expands. I noticed server side the NodeExpand and the client side onClientNodePopulating is called, but the onClientNodePopulated is never called. I connected up the onClientNodePopulatingFailed event, but its never fired.

    Any ideas?

    Thanks.
    Blair

  5. Blair
    Blair avatar
    22 posts
    Member since:
    Jun 2012

    Posted 25 Jun 2012 Link to this post

    I figured it out. There was a postback after the callback.

    Thanks.
Back to Top