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

A collection of RadPanelItem objects in a RadPanelBar control.

The RadPanelItemCollection class represents a collection of RadPanelItem objects.

  • Use the this[int] to programmatically retrieve a single RadPanelItem from the collection, using array notation.
  • Use the Count property to determine the total number of panel items in the collection.
  • Use the Add(RadPanelItem) method to add items in the collection.
  • Use the Remove(RadPanelItem) method to remove items from the collection.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class RadPanelItemCollection : ControlItemCollection, IList, ICollection, IEnumerable, IStateManager

Inheritance: objectStateManagedCollectionControlItemCollectionRadPanelItemCollection

Implements: ICollectionIEnumerableIListIStateManager

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.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 RadPanelItemCollection class.

C#
public RadPanelItemCollection(Control parent)
Parameters:parentControl

The owner of the collection.

Properties

Gets the RadPanelItem object at the specified index in the current RadPanelItemCollection.

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

The zero-based index of the RadPanelItem to retrieve.

Property Value:

The RadPanelItem at the specified index in the current RadPanelItemCollection.

Methods

Appends the specified RadPanelItem object to the end of the current RadPanelItemCollection.

C#
public void Add(RadPanelItem item)
Parameters:itemRadPanelItem

The RadPanelItem to append to the end of the current RadPanelItemCollection.

Example:
cs-api-definition
RadPanelItem newsItem = new RadPanelItem("News");
RadPanelBar1.Items.Add(newsItem);

Appends the specified array of RadPanelItem objects to the end of the current RadPanelItemCollection.

C#
public void AddRange(RadPanelItem[] items)

items

RadPanelItem[]

The array of <xref href="Telerik.Web.UI.RadPanelItem?text=RadPanelItem" data-throw-if-not-resolved="false"></xref> o append to the end of the current

RadPanelItemCollection.

Example:
cs-api-definition
RadPanelItem[] items = new RadPanelItem[] { new RadPanelItem("First"), new RadPanelItem("Second"), new RadPanelItem("Third") };
RadPanelBar1.Items.AddRange(items);

Determines whether the specified RadPanelItem object is in the current RadPanelItemCollection.

C#
public bool Contains(RadPanelItem item)
Parameters:itemRadPanelItem

The RadPanelItem object to find.

Returns:

bool

true if the current collection contains the specified RadPanelItem object; otherwise, false.

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

C#
public RadPanelItem FindItem(Predicate<RadPanelItem> match)
Parameters:matchPredicate<RadPanelItem>

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

Returns:

RadPanelItem

Example:
cs-api-definition
void Page_Load(object sender, EventArgs e)
{
RadPanel1.FindItem(ItemWithEqualsTextAndValue);
}
private static bool ItemWithEqualsTextAndValue(RadPanelItem item)
{
if (item.Text == item.Value)
{
return true;
}
else
{
return false;
}
}

Searches the nodes in the collection for a RadPanelItem which contains the specified attribute and attribute value.

C#
public RadPanelItem FindItemByAttribute(string attributeName, string attributeValue)
Parameters:attributeNamestring

The name of the target attribute.

attributeValuestring

The value of the target attribute

Returns:

RadPanelItem

The RadPanelItem that matches the specified arguments. Null (Nothing) is returned if no node is found.

This method is not recursive.

Searches the RadPanelbar control for the first RadPanelItem with a Text property equal to the specified value.

C#
public RadPanelItem FindItemByText(string text, bool ignoreCase)
Parameters:textstring

The value to search for.

ignoreCasebool

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

Returns:

RadPanelItem

A RadPanelItem whose Text property is equal to the specified value.

The method returns the first item matching the search criteria. If no item is matching then null (Nothing in VB.NET) is returned.

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

C#
public RadPanelItem FindItemByText(string text)
Parameters:textstring

The text to search for

Returns:

RadPanelItem

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

This method is not recursive.

Searches the RadPanelbar control for the first RadPanelItem with a Value property equal to the specified value.

C#
public RadPanelItem FindItemByValue(string value, bool ignoreCase)
Parameters:valuestring

The value to search for.

ignoreCasebool

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

Returns:

RadPanelItem

A RadPanelItem whose Value property is equal to the specified value.

The method returns the first item matching the search criteria. If no item is matching then null (Nothing in VB.NET) is returned.

Searches all nodes for a RadPanelItem with a Value property equal to the specified value.

C#
public RadPanelItem FindItemByValue(string value)
Parameters:valuestring

The value to search for

Returns:

RadPanelItem

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

This method is not recursive.

Determines the index of the specified RadPanelItem object in the collection.

C#
public int IndexOf(RadPanelItem item)
Parameters:itemRadPanelItem

The RadPanelItem to locate.

Returns:

int

The zero-based index of item within the current RadPanelItemCollection, if found; otherwise, -1.

Inserts the specified RadPanelItem object in the current RadPanelItemCollection at the specified index location.

C#
public void Insert(int index, RadPanelItem item)
Parameters:indexint

The zero-based index location at which to insert the RadPanelItem.

itemRadPanelItem

The RadPanelItem to insert.

Removes the specified RadPanelItem object from the current RadPanelItemCollection.

C#
public void Remove(RadPanelItem item)
Parameters:itemRadPanelItem

The RadPanelItem object to remove.

Removes the RadPanelItem object at the specified index from the current RadPanelItemCollection.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based index of the item to remove.

C#
protected override void SetOwner(ControlItem item)
Parameters:itemControlItem

Overrides: ControlItemCollection.SetOwner(ControlItem)