TreeView::CheckedNodes Property

 

Gets a collection of TreeNode objects that represent the nodes in the TreeView control that display a selected check box.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
[BrowsableAttribute(false)]
property TreeNodeCollection^ CheckedNodes {
	TreeNodeCollection^ get();
}

Property Value

Type: System.Web.UI.WebControls::TreeNodeCollection^

A TreeNodeCollection that contains the nodes in the TreeView that display a selected check box.

When check boxes are displayed in the TreeView control (by setting the ShowCheckBoxes property to a value other than TreeNodeType.None), use the CheckedNodes property to determine which nodes display a selected check box. This collection is commonly used to iterate through all the nodes that have a selected check box in the tree.

The TreeNodeCheckChanged event is raised when the check boxes of the TreeView control change state between posts to the server. This allows you to provide an event-handling method that performs a custom routine, such as updating a database or the displayed content, whenever this event occurs.

System_CAPS_noteNote

The CheckedNodes collection is populated using a depth-first traversal of the tree structure: each parent node is processed down to its child nodes before the next parent node is populated.

The following code example demonstrates how to use the CheckedNodes property to determine which nodes have a selected check box in the TreeView control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: