This is a migrated thread and some comments may be shown as answers.

preloaded node in webservice mode

1 Answer 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 10 Sep 2013, 05:24 PM
For my application, I need to have the root node and it's children all populated on initial load.   Descendants are to be loaded using webservice mode.   This is all working fine, i.e. the initial load displays all the children of the root, and when expanded the children load via the webservice.

The issue I'm having is with the root node.   If after the initial load, the root is collapsed and then expanded, the webservice is still called and a second set of children are added to the root.  It seems the root, from a load-on-demand perspective, doesn't know that its children are loaded.

How can the second load be avoided?

Dave


1 Answer, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 1
answered on 10 Sep 2013, 10:58 PM
I found a solution.  While building the tree within the codebehind, I set the root node's ExpandMode to ClientSide, while leaving its children at Webservice mode.  When the page renders, the root node and its children are all visible.  I am able to collapse and expand the root node, without getting a second load of the children, and the descendant nodes populate on demand using the webservice.  I'm happy, but if there is a better way, or this way presents some hidden danger, then please advise.

Thanks!
Dave
Tags
TreeView
Asked by
Dave
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Share this question
or