467,920 Members | 1,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,920 developers. It's quick & easy.

Dynamic Treeview : Showing Updating... while populating nodes

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

Sep 18 '06 #1
  • viewed: 1980
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Janus | last post: by
2 posts views Thread by Joe | last post: by
3 posts views Thread by Shawn | last post: by
reply views Thread by Erland | last post: by
1 post views Thread by doemon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.