A collection of RadToolBarItem objects in a RadToolBar control.
The RadToolBarItemCollection class represents a collection of RadToolBarItem objects. The RadToolBarItem objects in turn represent items (buttons, dropdowns or split buttons) within a RadToolBar control.
- Use the this[int] to programmatically retrieve a single RadToolBarItem from the collection, using array notation.
- Use the Count property to determine the total number of toolbar items in the collection.
- Use the Add(RadToolBarItem) method to add toolbar items to the collection.
- Use the Remove(RadToolBarItem) method to remove toolbar items from the collection.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadToolBarItemCollection : ControlItemCollection, IList, ICollection, IEnumerable, IStateManager
Inheritance: objectStateManagedCollectionControlItemCollectionRadToolBarItemCollection
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadToolBarItemCollection class.
public RadToolBarItemCollection(Control parent)
The owner of the collection.
Properties
Gets the RadToolBarItem object at the specified index in the current RadToolBarItemCollection.
public RadToolBarItem this[int index] { get; }
The zero-based index of the RadToolBarItem to retrieve.
Property Value:The RadToolBarItem at the specified index in the current RadToolBarItemCollection.
Methods
Appends the specified RadToolBarItem object to the end of the current RadToolBarItemCollection.
public void Add(RadToolBarItem item)
The RadToolBarItem to append to the end of the current RadToolBarItemCollection.
Appends the specified array of RadToolBarItem objects to the end of the current RadToolBarItemCollection.
public void AddRange(IEnumerable<RadToolBarItem> items)
The array of RadToolBarItem objects to append to the end of the current RadToolBarItemCollection.
Determines whether the specified RadToolBarItem object is in the current RadToolBarItemCollection.
public bool Contains(RadToolBarItem item)
The RadToolBarItem object to find.
Returns:true if the current collection contains the specified
RadToolBarItem object; otherwise, false.
Returns the first RadToolBarItem that matches the conditions defined by the specified predicate. The predicate should returns a boolean value.
public RadToolBarItem FindItem(Predicate<RadToolBarItem> match)
The Predicate <> that defines the conditions of the element to search for.
Returns:Searches the items in the collection for a RadToolBarItem which contains the specified attribute and attribute value.
public RadToolBarItem FindItemByAttribute(string attributeName, string attributeValue)
The name of the target attribute.
attributeValuestringThe value of the target attribute
Returns:The RadToolBarItem that matches the specified arguments. Null (Nothing) is returned if no node is found.
This method is not recursive.
Searches the ToolBarItemCollection for the first RadToolBarItem with a Text property equal to the specified value.
public RadToolBarItem FindItemByText(string text, bool ignoreCase)
The value to search for.
ignoreCaseboolA Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).
Returns:A RadToolBarItem which Text property is equal to the specified value.
The method returns the first item matching the search criteria. This method is not recursive. If no item is matching then null (Nothing in VB.NET) is returned.
Searches the ToolBarItemCollection for the first RadToolBarItem with a Text property equal to the specified value.
public RadToolBarItem FindItemByText(string text)
The value to search for.
Returns:A RadToolBarItem which Text property is equal to the specified value.
The method returns the first item matching the search criteria. This method is not recursive. If no item is matching then null (Nothing in VB.NET) is returned.
Searches the ToolBarItemCollection for the first button item (RadToolBarButton or RadToolBarSplitButton) with a Value property equal to the specified value.
public RadToolBarItem FindItemByValue(string value, bool ignoreCase)
The value to search for.
ignoreCaseboolA Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).
Returns:A button item which Value property is equal to the specified value.
The method returns the first item matching the search criteria. This method is not recursive. If no item is matching then null (Nothing in VB.NET) is returned.
Searches the ToolBarItemCollection for the first button item (RadToolBarButton or RadToolBarSplitButton) with a Value property equal to the specified value.
public RadToolBarItem FindItemByValue(string value)
The value to search for.
Returns:A button item which Value property is equal to the specified value.
The method returns the first item matching the search criteria. This method is not recursive. If no item is matching then null (Nothing in VB.NET) is returned.
Determines the index of the specified RadToolBarItem object in the collection.
public int IndexOf(RadToolBarItem item)
The RadToolBarItem to locate.
Returns:The zero-based index of a toolbar item within the current RadToolBarItemCollection, if found; otherwise, -1.
Inserts the specified RadToolBarItem object in the current RadToolBarItemCollection at the specified index location.
public void Insert(int index, RadToolBarItem item)
The zero-based index location at which to insert the RadToolBarItem.
itemRadToolBarItemThe RadToolBarItem to insert.
Removes the specified RadToolBarItem object from the current RadToolBarItemCollection.
public void Remove(RadToolBarItem item)
The RadToolBarItem object to remove.
Removes the RadToolBarItem object at the specified index from the current RadToolBarItemCollection.