SPNavigationNodeCollection Class

Provides a strongly typed collection of SPNavigationNode objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.Navigation.SPNavigationNodeCollection

Namespace:  Microsoft.SharePoint.Navigation
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableTypeAttribute(Name := "NavigationNodeCollection", ServerTypeId := "{2d818ed7-8fef-4a1c-bceb-a9404dfa482f}",  _
    CollectionChildItemType := GetType(SPNavigationNode))> _
<SubsetCallableTypeAttribute> _
Public NotInheritable Class SPNavigationNodeCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPNavigationNodeCollection
[ClientCallableTypeAttribute(Name = "NavigationNodeCollection", ServerTypeId = "{2d818ed7-8fef-4a1c-bceb-a9404dfa482f}", 
    CollectionChildItemType = typeof(SPNavigationNode))]
[SubsetCallableTypeAttribute]
public sealed class SPNavigationNodeCollection : SPBaseCollection

Remarks

An instance of this class is returned by the GlobalNodes, QuickLaunch, and TopNavigationBar properties of an SPNavigation object and also by the Children property of an SPNavigationNode object.

In a hierarchical navigation structure such as QuickLaunch, the tree is rooted on a single SPNavigationNode object. This object has a Children property that returns an SPNavigationNodeCollection object with navigation nodes one level down from the root. Each of these nodes has a Children property that can contain a collection of nodes for another level down the hierarchy.

You can get the parent node for a collection by getting the value of the collection's Parent property. You can return to the collection by getting the value of the parent node's Children property.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPNavigationNodeCollection Members

Microsoft.SharePoint.Navigation Namespace

Microsoft.SharePoint.Navigation.SPNavigationNode

Microsoft.SharePoint.SPBaseCollection

Other Resources

Adding Links to the Top Link Bar

Adding Links to Quick Launch