IHierarchyData.HasChildren Property
Assembly: System.Web (in system.web.dll)
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.