A collection of RadComboBoxItem objects in a RadComboBox control.
The RadComboBoxItemCollection class represents a collection of RadComboBoxItem objects.
- Use the this[int] to programmatically retrieve a single RadComboBoxItem from the collection, using array notation.
- Use the Count property to determine the total number of combo items in the collection.
- Use the Add(RadComboBoxItem) method to add items in the collection.
- Use the Remove(RadComboBoxItem) method to remove items from the collection.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class RadComboBoxItemCollection : ControlItemCollection, IList, ICollection, IStateManager, IList<RadComboBoxItem>, ICollection<RadComboBoxItem>, IEnumerable<RadComboBoxItem>, IEnumerable
Inheritance: objectStateManagedCollectionControlItemCollectionRadComboBoxItemCollection
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadComboBoxItemCollection class.
public RadComboBoxItemCollection(Control parent)
The owner of the collection.
Properties
Gets the RadComboBoxItem object at the specified index in the current RadComboBoxItemCollection.
public RadComboBoxItem this[int index] { get; set; }
The zero-based index of the RadComboBoxItem to retrieve.
Property Value:The RadComboBoxItem at the specified index in the current RadComboBoxItemCollection.
Implements:
Methods
Appends the specified RadComboBoxItem object to the end of the current RadComboBoxItemCollection.
public virtual void Add(RadComboBoxItem item)
The RadComboBoxItem to append to the end of the current RadComboBoxItemCollection.
Implements:
Appends an item to the collection.
protected override void AddItemToParentControls(int index, ControlItem item)
Overrides:
Appends the specified array of RadComboBoxItem objects to the end of the current RadComboBoxItemCollection.
public virtual void AddRange(IEnumerable<RadComboBoxItem> items)
items
The array of <xref href="Telerik.Web.UI.RadComboBoxItem?text=RadComboBoxItem" data-throw-if-not-resolved="false"></xref> o append to the end of the current
Determines whether the specified RadComboBoxItem object is in the current RadComboBoxItemCollection.
public virtual bool Contains(RadComboBoxItem item)
The RadComboBoxItem object to find.
Returns:true if the current collection contains the specified RadComboBoxItem object;
otherwise, false.
Returns the first RadComboBoxItem that matches the conditions defined by the specified predicate. The predicate should returns a boolean value.
public RadComboBoxItem FindItem(Predicate<RadComboBoxItem> match)
The Predicate <> that defines the conditions of the element to search for.
Returns:Searches the items in the collection for a RadComboBoxItem which contains the specified attribute and attribute value.
public RadComboBoxItem FindItemByAttribute(string attributeName, string attributeValue)
The name of the target attribute.
attributeValuestringThe value of the target attribute
Returns:The RadComboBoxItem that matches the specified arguments. Null (Nothing) is returned if no node is found.
This method is not recursive.
Finds the first RadComboBoxItem with Text that matches the given text value.
public RadComboBoxItem FindItemByText(string text, bool ignoreCase)
The string to search for.
ignoreCaseboolA Boolean indicating a case-sensitive or insensitive comparison (true indicates a case-insensitive comparison).
Returns:The first RadComboBoxItem that matches the specified text value.
Finds the first RadComboBoxItem with Text that matches the given text value.
public RadComboBoxItem FindItemByText(string text)
The string to search for.
Returns:The first RadComboBoxItem that matches the specified text value.
This method is not recursive.
Finds the first RadComboBoxItem with Value that matches the given value.
public RadComboBoxItem 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:The first RadComboBoxItem that matches the specified value.
Finds the first RadComboBoxItem with Value that matches the given value.
public RadComboBoxItem FindItemByValue(string value)
The value to search for.
Returns:The first RadComboBoxItem that matches the specified value.
This methods is not recursive.
Returns the index of the first RadComboBoxItem with Text that matches the given text value.
Returns the index of the first RadComboBoxItem with Value that matches the given value.
Determines the index of the specified RadComboBoxItem object in the collection.
public virtual int IndexOf(RadComboBoxItem item)
The RadComboBoxItem to locate.
Returns:The zero-based index of item within the current RadComboBoxItemCollection, if found; otherwise, -1.
Inserts the specified RadComboBoxItem object in the current RadComboBoxItemCollection at the specified index location.
public virtual void Insert(int index, RadComboBoxItem item)
The zero-based index location at which to insert the RadComboBoxItem.
itemRadComboBoxItemThe RadComboBoxItem to insert.
Inserts an item to the collection at the specified index.
public virtual void Insert(int index, string text)
The zero-based index location at which to insert the RadComboBoxItem.
textstringThe text of the new item.
Removes the specified RadComboBoxItem object from the current RadComboBoxItemCollection.
public virtual void Remove(int index)
The zero-based index of the index to remove.
Removes the specified RadComboBoxItem object from the current RadComboBoxItemCollection.
public virtual void Remove(RadComboBoxItem item)
The RadComboBoxItem object to remove.
Sort the items from RadComboBoxItemCollection.
public void Sort()
Sort the items from RadComboBoxItemCollection.
public void Sort(IComparer comparer)
An object from IComparer interface.