New to Telerik ReportingStart a free 30-day trial

Represents a collection of ReportItemBase objects.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

C#
public class ReportItemBase.ItemCollection : Collection<ReportItemBase>

Inheritance: objectCollection<ReportItemBase>ReportItemBase.ItemCollection

Constructors

Initializes a new instance of the ReportItemBase.ItemCollection class.

C#
public ItemCollection(ReportItemBase owner)
Parameters:ownerReportItemBase

A ReportItemBase representing the report item that owns the report item collection.

Properties

Returns the ReportItemBase with the specified key in the collection.

C#
public virtual ReportItemBase this[string key] { get; }
Parameters:keystring

The name of the report item to retrieve from the report item collection.

Property Value:

The ReportItemBase with the specified key in the collection.

Methods

Adds an array of report item objects to the collection.

C#
public virtual void AddRange(ReportItemBase[] items)
Parameters:itemsReportItemBase[]

An array of ReportItemBase objects to add to the collection.

Remarks:

The ReportItemBase objects contained in the items array are appended to the end of the collection.

You can use the AddRange method to quickly add a group of ReportItemBase objects to the collection instead of manually adding each ReportItemBase to the collection using the Add(T) method.

To remove a ReportItemBase that you previously added, use the Remove(T), RemoveAt(int), or Clear() methods.

TODO: Add documentation.

C#
protected override void ClearItems()

Overrides: Collection<ReportItemBase>.ClearItems()

Determines whether the ReportItemBase.ItemCollection contains an item with the specified key.

C#
public virtual bool ContainsKey(string key)
Parameters:keystring

The key to locate in the ReportItemBase.ItemCollection.

Returns:

bool

true if the ReportItemBase.ItemCollection contains an item with the specified key; otherwise, false.

Remarks:

The Name property of a ReportItemBase corresponds to the key for a ReportItemBase in the ReportItemBase.ItemCollection.

Searches for report items by their Name property and builds an array of all the report items that match.

C#
public virtual ReportItemBase[] Find(string key, bool recursive)
Parameters:keystring

The key to locate in the ReportItemBase.ItemCollection.

recursivebool

true to search all child report items; otherwise, false.

Returns:

ReportItemBase[]

An array of type ReportItemBase containing the matching report items.

Exceptions:

ArgumentNullException

The key parameter is null or empty.

Searches for report items by their Type and builds an array of all the items that match.

C#
public virtual ReportItemBase[] Find(Type type, bool recursive)
Parameters:typeType

The Type to search for.

recursivebool

A value indicating whether to search all children recursively.

Returns:

ReportItemBase[]

An array of type ReportItemBase containing the matching report items.

Searches for report items by their Type and builds an array of all the items that match.

C#
public virtual ReportItemBase[] Find(Type type)
Parameters:typeType

The Type to search for.

Returns:

ReportItemBase[]

An array of type ReportItemBase containing the matching report items.

Searches the collection for a report item of the specified type.

C#
public virtual ReportItemBase FindItem(Type type)
Parameters:typeType

The Type to search for.

Returns:

ReportItemBase

The first ReportItemBase in the collection that matches the given Type. If no item in the collection matches the given Type the method returns null.

Retrieves the index of the specified child report item within the item collection, and optionally raises an exception if the specified report item is not within the item collection.

C#
public virtual int GetChildIndex(ReportItemBase child, bool throwException)
Parameters:childReportItemBase

The ReportItemBase to search for in the item collection.

throwExceptionbool

true to throw an exception if the ReportItemBase specified in the child parameter is not an item in the ReportItemBase.ItemCollection; otherwise, false.

Returns:

int

A zero-based index value that represents the location of the specified child report item within the item collection; otherwise -1 if the specified ReportItemBase is not found in the ReportItemBase.ItemCollection.

Exceptions:

ArgumentException

The child is not contained in the collection and the throwException parameter is true.

Retrieves the index of a report item within the item collection.

C#
public int GetChildIndex(ReportItemBase child)
Parameters:childReportItemBase

The ReportItemBase to search for in the item collection.

Returns:

int

A zero-based index value that represents the location of the specified child report item within the item collection.

Retrieves the index of the first occurrence of the specified item within the collection.

C#
public virtual int IndexOfKey(string key)
Parameters:keystring

The name of the report item to search for.

Returns:

int

The zero-based index of the first occurrence of the report item with the specified name in the collection.

Remarks:

The key comparison is not case-sensitive. If the key parameter is a null reference (Nothing in Visual Basic) or an empty string, or an item with the specified key is not found, IndexOfKey returns -1.

The Name property of a ReportItemBase corresponds to the key for a ReportItemBase in the ReportItemBase.ItemCollection.

Overrides the InsertItem(int, T) method to perform validation and notify the owner when a new item is inserted.

C#
protected override void InsertItem(int index, ReportItemBase item)
Parameters:indexint

The zero-based index at which to insert the item.

itemReportItemBase

The new ReportItemBase to insert at the specified index.

Overrides: Collection<ReportItemBase>.InsertItem(int, ReportItemBase)

Removes the child report item with the specified key.

C#
public virtual void RemoveByKey(string key)
Parameters:keystring

The name of the child report item to remove.

Remarks:

The Name property of a ReportItemBase corresponds to the key for a ReportItemBase in the ReportItemBase.ItemCollection.

Overrides the RemoveItem(int) method to perform additional logic when an item is removed from the collection.

C#
protected override void RemoveItem(int index)
Parameters:indexint

The zero-based index of the item to remove.

Overrides: Collection<ReportItemBase>.RemoveItem(int)

TODO: Add documentation.

C#
protected override void SetItem(int index, ReportItemBase item)
Parameters:indexintitemReportItemBase

Overrides: Collection<ReportItemBase>.SetItem(int, ReportItemBase)