IHierarchyData.GetParent Method

Gets an IHierarchyData object that represents the parent node of the current hierarchical node.

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

IHierarchyData^ GetParent ()
IHierarchyData GetParent ()
function GetParent () : IHierarchyData
Not applicable.

Return Value

An IHierarchyData object that represents the parent node of the current hierarchical node.

The IHierarchyData interface does not define a HasParent convenience property, so callers must check the return value of the GetParent method for a null reference (Nothing in Visual Basic) to determine whether the current IHierarchyData node is the root node of the hierarchical data structure to which the node belongs.

The following code example demonstrates how to implement the GetParent method in a class that implements the IHierarchyData interface. The FileSystemHierarchyData class wraps a FileSystemInfo object, and the GetParent method implementation checks the type of the FileSystemInfo object, and returns the appropriate parent object based on the type. This code example is part of a larger example provided for the IHierarchyData interface and the HierarchicalDataSourceControl 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: