Class
GridViewRowCollection

Represents a collection that stores the grid rows

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

cs-api-definition
public class GridViewRowCollection : IEnumerable, INotifyCollectionChanged

Inheritance: objectGridViewRowCollection

Implements: IEnumerableINotifyCollectionChanged

Constructors

GridViewRowCollection(GridViewTemplate)

Initializes a new instance of the GridViewRowCollection class.

Declaration

cs-api-definition
public GridViewRowCollection(GridViewTemplate owner)

Parameters

owner

GridViewTemplate

The owner.

Properties

Count

Gets the number of elements contained in the ICollection<T>.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

Owner

Gets the owner.

Declaration

cs-api-definition
public GridViewTemplate Owner { get; }

Property Value

GridViewTemplate

The owner.

this[int]

Gets or sets the GridViewRowInfo at the specified index.

Declaration

cs-api-definition
public GridViewRowInfo this[int index] { get; set; }

Parameters

index

int

Property Value

GridViewRowInfo

Methods

Add(GridViewRowInfo)

Adds an item to the ICollection<T>.

Declaration

cs-api-definition
public void Add(GridViewRowInfo item)

Parameters

item

GridViewRowInfo

The object to add to the ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Add(params object[])

Adds a row to the collection

Declaration

cs-api-definition
public int Add(params object[] values)

Parameters

values

object[]

A variable number of objects that populate the cells of the new GridViewRowInfo.

Returns

int

The sorted index of the new row.

AddNew()

Adds a new row to the rows collection.

Declaration

cs-api-definition
public GridViewRowInfo AddNew()

Returns

GridViewRowInfo

An instance GridViewRowInfo

AddRange(params GridViewRowInfo[])

Adds the range.

Declaration

cs-api-definition
public virtual void AddRange(params GridViewRowInfo[] rows)

Parameters

rows

GridViewRowInfo[]

The rows.

Clear()

Removes all items from the ICollection<T>.

Declaration

cs-api-definition
public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(GridViewRowInfo)

Determines whether the ICollection<T> contains a specific value.

Declaration

cs-api-definition
public bool Contains(GridViewRowInfo item)

Parameters

item

GridViewRowInfo

The object to locate in the ICollection<T>.

Returns

bool

true if item is found in the ICollection<T>; otherwise, false.

CopyTo(GridViewRowInfo[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

Declaration

cs-api-definition
public void CopyTo(GridViewRowInfo[] array, int arrayIndex)

Parameters

array

GridViewRowInfo[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex

int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

<code class="paramref">array</code> is multidimensional.

-or- arrayIndex is equal to or greater than the length of array. -or- The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array. -or- Type T cannot be cast automatically to the type of the destination array.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration

cs-api-definition
public IEnumerator<GridViewRowInfo> GetEnumerator()

Returns

IEnumerator<GridViewRowInfo>

A IEnumerator<T> that can be used to iterate through the collection.

IndexOf(GridViewRowInfo)

Determines the index of a specific item in the IList<T>.

Declaration

cs-api-definition
public int IndexOf(GridViewRowInfo item)

Parameters

item

GridViewRowInfo

The object to locate in the IList<T>.

Returns

int

The index of item if found in the list; otherwise, -1.

Insert(int, GridViewRowInfo)

Inserts an item to the IList<T> at the specified index.

Declaration

cs-api-definition
public void Insert(int index, GridViewRowInfo item)

Parameters

index

int

The zero-based index at which item should be inserted.

item

GridViewRowInfo

The object to insert into the IList<T>.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Move(int, int)

Moves a specified row in unbound mode

Declaration

cs-api-definition
public void Move(int oldIndex, int newIndex)

Parameters

oldIndex

int

The old index of the row.

newIndex

int

The new index of the row.

NewRow()

Create new row. The new row is not added to collection.

Declaration

cs-api-definition
public GridViewRowInfo NewRow()

Returns

GridViewRowInfo

OnCollectionChanged(NotifyCollectionChangedEventArgs)

Raises the event.

Declaration

cs-api-definition
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)

Parameters

args

NotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs instance containing the event data.

Remove(GridViewRowInfo)

Removes the first occurrence of a specific object from the ICollection<T>.

Declaration

cs-api-definition
public bool Remove(GridViewRowInfo item)

Parameters

item

GridViewRowInfo

The object to remove from the ICollection<T>.

Returns

bool

true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.

Exceptions

NotSupportedException

The ICollection<T> is read-only.

RemoveAt(int)

Removes the IList<T> item at the specified index.

Declaration

cs-api-definition
public void RemoveAt(int index)

Parameters

index

int

The zero-based index of the item to remove.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the IList<T>.

NotSupportedException

The IList<T> is read-only.

Events

CollectionChanged

Occurs when the collection changes.

Declaration

cs-api-definition
public event NotifyCollectionChangedEventHandler CollectionChanged

Event Value

NotifyCollectionChangedEventHandler

Implements INotifyCollectionChanged.CollectionChanged