A collection of RadToolBarButton objects in RadToolBarDropDown and RadToolBarSplitButton.
The RadToolBarButtonCollection class represents a collection of RadToolBarButton objects. The RadToolBarButton objects in turn represent buttons within a RadToolBarDropDown or a RadToolBarSplitButton.
- Use the this[int] to programmatically retrieve a single RadToolBarButton from the collection, using array notation.
- Use the Count property to determine the total number of buttons in the collection.
- Use the Add(RadToolBarButton) method to add buttons to the collection.
- Use the Remove(RadToolBarButton) method to remove buttons from the collection.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadToolBarButtonCollection : RadToolBarItemCollection, IList, ICollection, IEnumerable, IStateManager
Inheritance: objectStateManagedCollectionControlItemCollectionRadToolBarItemCollectionRadToolBarButtonCollection
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadToolBarButtonCollection class.
public RadToolBarButtonCollection(Control parent)
The owner of the collection.
Properties
Gets the RadToolBarButton object at the specified index in the current RadToolBarButtonCollection.
public RadToolBarButton this[int index] { get; }
The zero-based index of the RadToolBarButton to retrieve.
Property Value:The RadToolBarButton at the specified index in the current RadToolBarButtonCollection.
Methods
Appends the specified RadToolBarButton object to the end of the current RadToolBarButtonCollection.
public void Add(RadToolBarButton item)
The RadToolBarButton to append to the end of the current RadToolBarButtonCollection.
Appends the specified array of RadToolBarButton objects to the end of the current RadToolBarButtonCollection.
public void AddRange(IEnumerable<RadToolBarButton> buttons)
The array of RadToolBarButton objects to append to the end of the current RadToolBarButtonCollection.
Determines whether the specified RadToolBarButton object is in the current RadToolBarButtonCollection.
public bool Contains(RadToolBarButton button)
The RadToolBarButton object to find.
Returns:true if the current collection contains the specified
RadToolBarButton object; otherwise, false.
Searches the items in the collection for a RadToolBarButton which contains the specified attribute and attribute value.
public RadToolBarButton FindButtonByAttribute(string attributeName, string attributeValue)
The name of the target attribute.
attributeValuestringThe value of the target attribute
Returns:The RadToolBarButton that matches the specified arguments.
Null (Nothing) is returned if no node is found.
This method is not recursive.
Searches the RadToolBarButtonCollection for the first RadToolBarButton with a Text property equal to the specified value.
public RadToolBarButton FindButtonByText(string text)
The value to search for.
Returns:A RadToolBarButton 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 RadToolBarButtonCollection for the first RadToolBarButton with a Value property equal to the specified value.
public RadToolBarButton FindButtonByValue(string value)
The value to search for.
Returns:A RadToolBarButton whose 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 RadToolBarButton object in the collection.
public int IndexOf(RadToolBarButton button)
The RadToolBarButton to locate.
Returns:The zero-based index of a toolbar button within the current RadToolBarButtonCollection, if found; otherwise, -1.
Inserts the specified RadToolBarButton object in the current RadToolBarButtonCollection at the specified index location.
public void Insert(int index, RadToolBarButton button)
The zero-based index location at which to insert the RadToolBarButton.
buttonRadToolBarButtonThe RadToolBarButton to insert.
Removes the specified RadToolBarButton object from the current RadToolBarButtonCollection.
public void Remove(RadToolBarButton button)
The RadToolBarButton object to remove.
Removes the RadToolBarButton object at the specified index from the current RadToolBarButtonCollection.