IHierarchyData::GetParent Method
Gets an IHierarchyData object that represents the parent node of the current hierarchical node.
Assembly: System.Web (in System.Web.dll)
Return Value
Type: System.Web.UI::IHierarchyDataAn 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 nullptr 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.
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.