asp.net.ph

TreeNode.PopulateOnDemand Property

System.Web.UI.TreeNodes Namespace   TreeNode Class


.NET Framework version 2.0

Sets or retrieves a value indicating whether a TreeNode is populated dynamically.

Syntax


Inline <asp:treenode populateondemand = true | false ... >
Script TreeNode.PopulateOnDemand [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true to populate the node dynamically; otherwise, false. Default value is false

Remarks

Use the PopulateOnDemand property to specify or determine whether a TreeNode is populated dynamically in a TreeView control.

There are cases where it is not practical to statically predefine the tree structure due to data size or custom content that depends on user input. For these cases, the TreeView control supports dynamic node population.

When a node's PopulateOnDemand property is set to true, that node is populated at run time through a postback event when the node is expanded. To populate a node dynamically, an event-handling method that populates the node must be defined for the TreeNodePopulate event.

Supported browsers can also take advantage of client-side node population. When the PopulateNodesFromClient is enabled, this allows the TreeView control to dynamically populate a node on the client when that node is expanded, which prevents the need to post back to the server.

Example

The following examples demonstrate how to populate the nodes of a TreeView control dynamically.

Populating TreeView Nodes On Demand
Run Sample | View Source
Populating TreeView Nodes On Demand Using Page Titles
Run Sample | View Source
Populating TreeView Nodes from a Database
Run Sample | View Source
See Also

TreeNode Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph