New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Represents a collection of RadSiteMapNode objects in a RadSiteMap control.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class RadSiteMapNodeCollection : ControlItemCollection, IList, ICollection, IStateManager, IList<RadSiteMapNode>, ICollection<RadSiteMapNode>, IEnumerable<RadSiteMapNode>, IEnumerable

Inheritance: objectStateManagedCollectionControlItemCollectionRadSiteMapNodeCollection

Implements: ICollectionICollection<RadSiteMapNode>IEnumerableIEnumerable<RadSiteMapNode>IListIList<RadSiteMapNode>IStateManager...

Inherited Members ControlItemCollection.VisibleChildren<T>()ControlItemCollection.Add(ControlItem)ControlItemCollection.Contains(ControlItem)ControlItemCollection.CopyTo(ControlItem[], int)ControlItemCollection.AddRange(IEnumerable<ControlItem>)ControlItemCollection.IndexOf(ControlItem)ControlItemCollection.Insert(int, ControlItem)ControlItemCollection.Remove(ControlItem)ControlItemCollection.RemoveAt(int)ControlItemCollection.FindChild<TControlItem>(Predicate<TControlItem>)ControlItemCollection.FindChildByText<TControlItem>(string)ControlItemCollection.FindChildByValue<TControlItem>(string)ControlItemCollection.FindChildByAttribute<TControlItem>(string, string)ControlItemCollection.FindChildByValue<TControlItem>(string, bool)ControlItemCollection.FindChildByText<TControlItem>(string, bool)ControlItemCollection.AddItemToParentControls(int, ControlItem)ControlItemCollection.OnInsertComplete(int, object)ControlItemCollection.OnRemoveComplete(int, object)ControlItemCollection.OnClear()ControlItemCollection.SetDirtyObject(object)ControlItemCollection.ParentControlItemCollection.VisibleItemsControlItemCollection.ListStateManagedCollection.Clear()StateManagedCollection.CopyTo(Array, int)StateManagedCollection.CreateKnownType(int)StateManagedCollection.GetEnumerator()StateManagedCollection.GetKnownTypes()StateManagedCollection.OnClearComplete()StateManagedCollection.OnValidate(object)StateManagedCollection.OnInsert(int, object)StateManagedCollection.OnRemove(int, object)StateManagedCollection.SetDirty()StateManagedCollection.Countobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

Initializes a new instance of the RadSiteMapNodeCollection class.

C#
public RadSiteMapNodeCollection(Control parent)
Parameters:parentControl

The parent RadSiteMap control.

Properties

Gets or sets the RadSiteMapNode at the specified index.

C#
public RadSiteMapNode this[int index] { get; set; }
Parameters:indexint

Implements: IList<RadSiteMapNode>.this[int]

Methods

Appends a node to the collection.

C#
public void Add(RadSiteMapNode node)
Parameters:nodeRadSiteMapNode

The node to add to the collection.

Implements: ICollection<RadSiteMapNode>.Add(RadSiteMapNode)

Appends the specified array of RadSiteMapNode objects to the end of the current RadSiteMapNodeCollection.

C#
public virtual void AddRange(IEnumerable<RadSiteMapNode> nodes)
Parameters:nodesIEnumerable<RadSiteMapNode>

The array of RadSiteMapNode to append to the end of the current RadSiteMapNodeCollection.

Example:
cs-api-definition
RadSiteMapNode[] nodes = new RadSiteMapNode[] { new RadSiteMapNode("First"), new RadSiteMapNode("Second"), new RadSiteMapNode("Third") };
RadSiteMap1.Nodes.AddRange(nodes);

Returns the first RadSiteMapNode that matches the conditions defined by the specified predicate. The predicate should returns a boolean value.

C#
public RadSiteMapNode FindNode(Predicate<RadSiteMapNode> match)
Parameters:matchPredicate<RadSiteMapNode>

The Predicate <RadSiteMapNode> that defines the conditions of the element to search for.

Returns:

RadSiteMapNode

Example:
cs-api-definition
void Page_Load(object sender, EventArgs e)
{
RadSiteMap1.FindNode(NodeWithEqualsTextAndValue);
}
private static bool NodeWithEqualsTextAndValue(RadSiteMapNode node)
{
if (node.Text == node.Value)
{
return true;
}
else
{
return false;
}
}

Searches all nodes for a RadSiteMapNode with a Text property equal to the specified text.

C#
public RadSiteMapNode FindNodeByText(string text, bool ignoreCase)
Parameters:textstring

The text to search for

ignoreCasebool

A Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).

Returns:

RadSiteMapNode

A RadSiteMapNode whose Text property equals to the specified argument Null (Nothing) is returned when no matching node is found.

This method is not recursive.

Searches all nodes for a RadSiteMapNode with a Text property equal to the specified text.

C#
public RadSiteMapNode FindNodeByText(string text)
Parameters:textstring

The text to search for

Returns:

RadSiteMapNode

A RadSiteMapNode whose Text property equals to the specified argument. Null (Nothing) is returned when no matching node is found.

This method is not recursive.

Inserts a node to the collection at the specified index.

C#
public void Insert(int index, RadSiteMapNode node)
Parameters:indexint

The zero-based index at which node should be inserted.

nodeRadSiteMapNode

The node to insert into the collection.

Removes the specified node from the collection.

C#
public void Remove(RadSiteMapNode node)
Parameters:nodeRadSiteMapNode

The node to remove from the collection.

C#
protected override void SetOwner(ControlItem node)
Parameters:nodeControlItem

Overrides: ControlItemCollection.SetOwner(ControlItem)