IHierarchyData.HasChildren Property

Indicates whether the hierarchical data node that the IHierarchyData object represents has any child nodes.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

property bool HasChildren {
	bool get ();
}
/** @property */
boolean get_HasChildren ()

function get HasChildren () : boolean

Not applicable.

Property Value

true if the current node has child nodes; otherwise, false.

The HasChildren property is a convenience property that enables callers to avoid checking the return value of the GetChildren method for a null reference (Nothing in Visual Basic). If the HasChildren property returns true, call the GetChildren method to retrieve an IHierarchicalEnumerable collection of child nodes.

The following code example demonstrates how an ASP.NET hierarchical data-bound control uses an IHierarchyData object in a recursive data-binding method. The items in an IHierarchicalEnumerable collection are enumerated, and for each an IHierarchyData object is retrieved using the GetHierarchyData method. Finally, the HasChildren property is checked to determine whether to recurse. This code example is part of a larger example provided for the HierarchicalDataBoundControl class.

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

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: