Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
660
Loadondemand property
posted

Also, I'm wondering about the loadondemand property.  If it is automatic, the documentation says that it will load data when the page loads.  Then, if that is the case, why even use it?  I thought the whole point was to only load data when a node is expanded and there are child nodes below it.  It also says that manual will only load when user expands a node, so shouldn't it be true or false then?  Unless, the documentation is missing something important?

 

 

 

Parents
No Data
Reply
  • 45049
    Suggested Answer
    posted

    Both "Automatic" and "Manual" settings for load-on-demand are triggered in the same way.  The root-level nodes are loaded on the initial page load, and when a node is expanded and doesn't yet have any child rows, a postback is triggered to retrieve child rows.  They differ in the following ways:

    • For "Automatic" load-on-demand, you would databind the tree to a hierarchical data source, which contains data appropriate for all levels in the tree.  The control takes care of the rest - it retrieves only the root data on initial page load, and determines which subset of child data to retrieve on postbacks triggered to get more data.
    • For "Manual" load-on-demand, you would either bind the tree to a data source that represents only the first level of data, or you'd manually populate that first level with nodes.  You need to handle the DemandLoad event, and in this event provide the logic needed to add the appropriate child nodes to the node that was just expanded.

    In short, "Automatic" does the plumbing for you, while "Manual" gives you more control.

Children