Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# - TreeView - Client Side Options - Remove Node

Status
Not open for further replies.

sipps

Technical User
Feb 9, 2003
133
GB
Hi,

I'm currently building a page which has a tree view control. I would like to build the tree on the fly rather than downloading all the data at once as there is a load of data which takes too long to download at once.

This is fine as the stored procedures I'm using return a count of any child items, and if this count is greater than 0 then I add a dummy child node.

I then have an onexpand function which gets the child items of the expanded folder. Problem is that on the onexpand event, the first thing the treeview does is display the dummy node for a splite second, then it postsbacks to run the server side function which removes the dummy node and populates the nodes with the correct data.

I have a client side function which fires on the onExpand event, but I can't seem to remove the child dummy node of the folder which I am expanding.

Does anyone know how I can remove child nodes from a folder which I am expanding client side before the postback?

Cheers
 
Could you not just set your dummy node text to something like "Gathering Data..." then it doesn't really matter that it is displayed for a split second?

If not, then you may be able to use the style attribute to set the display to hidden.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Hi ca8msm,

Thanks for your reply. That is a good suggestion. I am having problems getting reference to the child dummy node though.

opTreeView.SelectedNodeIndex = zpNodeIndex;

The above gets me the parent node to which I have expanded. I need to get the child node which belongs to this though, and I can't seem to get it working.

I have looked at the getChildren method which returns an array of child items, but have not successfully put this to use.

Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top