TreeView.CheckedNodes Property

Note: This property is new in the .NET Framework version 2.0.

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:
property TreeNodeCollection^ CheckedNodes {
	TreeNodeCollection^ get ();
}
/** @property */
public TreeNodeCollection get_CheckedNodes ()

public function get CheckedNodes () : TreeNodeCollection

Property Value

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.

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.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: