This documentation is archived and is not being maintained.

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)

[BrowsableAttribute(false)]
public:
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.

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

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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