Dynamic Treeview : Showing Updating... while populating nodes

Discussion in 'ASP .Net' started by drop, Sep 18, 2006.

  1. drop

    drop Guest

    Hi,

    I'm currently working with the Treeview control in ASP .Net 2.0. The
    tree is filled dynamically based on data contained in a MySQL Database.

    Here is the exact behavior I want :

    1 - User clicks on a node to expand it.
    2 - Add a child node to the node clicked by the user saying the tree is
    loading that part. So here, I also need to expand the node clicked by
    the user.
    3 - Send a request to the server to populate the node clicked by the
    user.
    4 - When the request comes back, update only the part of the treeview
    that needs updating, I don't want to reload the whole page.

    Currently, I'm able to get behavior 1, 3 and 4 by using the built-in
    features of the Treeview, but I'm having problem with 2. Here is the
    code I'm using for the treeview :

    <asp:TreeView ID="InventoryTreeView" runat="server" ExpandDepth="1"
    OnTreeNodePopulate="PopulateNode"
    OnSelectedNodeChanged="SelectNodeChanged"
    EnableClientScript="true"
    PopulateNodesFromClient="true" ImageSet="Simple" NodeIndent="10"
    ShowLines="True">
    <Nodes>
    <asp:TreeNode Text="Inventory" Value="Root"
    Expanded="True">
    <asp:TreeNode Text="Adventure"
    Value="Adventure" PopulateOnDemand="True"></asp:TreeNode>
    <asp:TreeNode Text="Cruise"
    Value="Cruise" PopulateOnDemand="True"></asp:TreeNode>
    <asp:TreeNode Text="Resort"
    Value="Resort" PopulateOnDemand="True"></asp:TreeNode>
    <asp:TreeNode Text="Tour" Value="Tour"
    PopulateOnDemand="True"></asp:TreeNode>
    </asp:TreeNode>
    </Nodes>
    </asp:TreeView>

    Does anyone has any hint on how I could make #2 happen, even if it
    means rewriting the code used to make the other points work?

    I tough of a solution but I'm one step short of doing it. I could use
    the TreeNodePopulate events to add the loading node I need in step 2.
    What I'm unable to figure out is how to send back another message to
    the server to make the real node population from there. Anyone has any
    idea on the event I could use to make that? I already tried using the
    TreeNodeExpanded event, but that doesn't work.

    Thanks
    drop, Sep 18, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    434
    Arnaud Berger
    May 23, 2005
  2. gavnosis
    Replies:
    0
    Views:
    509
    gavnosis
    Aug 2, 2003
  3. news.rcn.com
    Replies:
    2
    Views:
    1,112
    Roedy Green
    Dec 10, 2007
  4. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    458
    Steve Drake
    Oct 15, 2003
  5. lourivas

    TreeView Webcontrol dynamic adding nodes problems

    lourivas, Oct 28, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    170
    Annie
    Nov 1, 2005
Loading...

Share This Page