Class
ReportItemBase.ItemCollection

Represents a collection of ReportItemBase objects.

Definition

Namespace:Telerik.Reporting

Assembly:Telerik.Reporting.dll

Syntax:

cs-api-definition
public class ReportItemBase.ItemCollection : Collection<ReportItemBase>

Inheritance: objectCollection<ReportItemBase>ReportItemBase.ItemCollection

Constructors

ItemCollection(ReportItemBase)

Initializes a new instance of the ReportItemBase.ItemCollection class.

Declaration

cs-api-definition
public ItemCollection(ReportItemBase owner)

Parameters

owner

ReportItemBase

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

Properties

this[string]

Returns the ReportItemBase with the specified key in the collection.

Declaration

cs-api-definition
public virtual ReportItemBase this[string key] { get; }

Parameters

key

string

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

Property Value

ReportItemBase

The ReportItemBase with the specified key in the collection.

Methods

AddRange(ReportItemBase[])

Adds an array of report item objects to the collection.

Declaration

cs-api-definition
public virtual void AddRange(ReportItemBase[] items)

Parameters

items

ReportItemBase[]

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.

ClearItems()

TODO: Add documentation.

Declaration

cs-api-definition
protected override void ClearItems()

Overrides Collection<ReportItemBase>.ClearItems()

ContainsKey(string)

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

Declaration

cs-api-definition
public virtual bool ContainsKey(string key)

Parameters

key

string

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.

Find(Type)

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

Declaration

cs-api-definition
public virtual ReportItemBase[] Find(Type type)

Parameters

type

Type

The Type to search for.

Returns

ReportItemBase[]

An array of type ReportItemBase containing the matching report items.

Find(Type, bool)

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

Declaration

cs-api-definition
public virtual ReportItemBase[] Find(Type type, bool recursive)

Parameters

type

Type

The Type to search for.

recursive

bool

A value indicating whether to search all children recursively.

Returns

ReportItemBase[]

An array of type ReportItemBase containing the matching report items.

Find(string, bool)

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

Declaration

cs-api-definition
public virtual ReportItemBase[] Find(string key, bool recursive)

Parameters

key

string

The key to locate in the ReportItemBase.ItemCollection.

recursive

bool

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.

FindItem(Type)

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

Declaration

cs-api-definition
public virtual ReportItemBase FindItem(Type type)

Parameters

type

Type

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.

GetChildIndex(ReportItemBase)

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

Declaration

cs-api-definition
public int GetChildIndex(ReportItemBase child)

Parameters

child

ReportItemBase

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.

GetChildIndex(ReportItemBase, bool)

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.

Declaration

cs-api-definition
public virtual int GetChildIndex(ReportItemBase child, bool throwException)

Parameters

child

ReportItemBase

The ReportItemBase to search for in the item collection.

throwException

bool

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.

IndexOfKey(string)

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

Declaration

cs-api-definition
public virtual int IndexOfKey(string key)

Parameters

key

string

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.

InsertItem(int, ReportItemBase)

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

Declaration

cs-api-definition
protected override void InsertItem(int index, ReportItemBase item)

Parameters

index

int

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

item

ReportItemBase

The new ReportItemBase to insert at the specified index.

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

RemoveByKey(string)

Removes the child report item with the specified key.

Declaration

cs-api-definition
public virtual void RemoveByKey(string key)

Parameters

key

string

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.

RemoveItem(int)

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

Declaration

cs-api-definition
protected override void RemoveItem(int index)

Parameters

index

int

The zero-based index of the item to remove.

Overrides Collection<ReportItemBase>.RemoveItem(int)

SetItem(int, ReportItemBase)

TODO: Add documentation.

Declaration

cs-api-definition
protected override void SetItem(int index, ReportItemBase item)

Parameters

index

int

item

ReportItemBase

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