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

A collection of RadTab objects in a RadTabStrip control.

The RadTabCollection class represents a collection of RadTab objects.

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

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class RadTabCollection : ControlItemCollection, IList, ICollection, IStateManager, IEnumerable<RadTab>, IEnumerable

Inheritance: objectStateManagedCollectionControlItemCollectionRadTabCollection

Implements: ICollectionIEnumerableIEnumerable<RadTab>IListIStateManager

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

C#
public RadTabCollection(Control parent)
Parameters:parentControl

The owner of the collection.

Properties

Gets the RadTab object at the specified index in the current RadTabCollection.

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

The zero-based index of the RadTab to retrieve.

Property Value:

The RadTab at the specified index in the current RadTabCollection.

Methods

Appends the specified RadTab object to the end of the current RadTabCollection.

C#
public void Add(RadTab tab)
Parameters:tabRadTab

The RadTab to append to the end of the current RadTabCollection.

Example:
cs-api-definition
RadTab newsTab = new RadTab("News");
RadTabStrip1.Tabs.Add(newsTab);

Appends the specified array of RadTab objects to the end of the current RadTabCollection.

C#
public void AddRange(RadTab[] tabs)

tabs

RadTab[]

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

RadTabCollection.

Example:
cs-api-definition
RadTab[] tabs = new RadTab[] { new RadTab("First"), new RadTab("Second"), new RadTab("Third") };
RadTabStrip1.Tabs.AddRange(tabs);

Determines whether the specified RadTab object is in the current RadTabCollection.

C#
public bool Contains(RadTab tab)
Parameters:tabRadTab

The RadTab object to find.

Returns:

bool

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

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

C#
public RadTab FindTab(Predicate<RadTab> match)
Parameters:matchPredicate<RadTab>

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

Returns:

RadTab

Example:
cs-api-definition
void Page_Load(object sender, EventArgs e)
{
RadTabStrip1.FindTab(ItemWithEqualsTextAndValue);
}
private static bool ItemWithEqualsTextAndValue(RadTab tab)
{
if (tab.Text == tab.Value)
{
return true;
}
else
{
return false;
}
}

Searches the RadTabStrip control for the first RadTab whose Text property is equal to the specified value.

C#
public RadTab FindTabByText(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:

RadTab

A RadTab whose Text property is equal to the specified value. If a tab is not found, null (Nothing in Visual Basic) is returned.

Searches the RadTabStrip control for the first RadTab whose Text property is equal to the specified value.

C#
public RadTab FindTabByText(string text)
Parameters:textstring

The value to search for.

Returns:

RadTab

A RadTab whose Text property is equal to the specified value. If a tab is not found, null (Nothing in Visual Basic) is returned.

Searches the RadTabStrip control for the first RadTab whose Value property is equal to the specified value.

C#
public RadTab FindTabByValue(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:

RadTab

A RadTab whose Value property is equal to the specifed value. If a tab is not found, null (Nothing in Visual Basic) is returned.

Searches the RadTabStrip control for the first RadTab whose Value property is equal to the specified value.

C#
public RadTab FindTabByValue(string value)
Parameters:valuestring

The value to search for.

Returns:

RadTab

A RadTab whose Value property is equal to the specifed value. If a tab is not found, null (Nothing in Visual Basic) is returned.

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

C#
public int IndexOf(RadTab tab)
Parameters:tabRadTab

The RadTab to locate.

Returns:

int

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

Inserts the specified RadTab object in the current RadTabCollection at the specified index location.

C#
public void Insert(int index, RadTab tab)
Parameters:indexint

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

tabRadTab

The RadTab to insert.

C#
protected override void OnInsert(int index, object value)
Parameters:indexintvalueobject

Overrides: StateManagedCollection.OnInsert(int, object)

C#
protected override void OnInsertComplete(int index, object value)
Parameters:indexintvalueobject

Overrides: ControlItemCollection.OnInsertComplete(int, object)

Removes the specified RadTab object from the current RadTabCollection.

C#
public void Remove(RadTab tab)
Parameters:tabRadTab

The RadTab object to remove.

Removes the RadTab object at the specified index from the current RadTabCollection.

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

The zero-based index of the tab to remove.

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

Overrides: ControlItemCollection.SetOwner(ControlItem)