New to Telerik UI for WinFormsStart a free 30-day trial

Represents a collection that stores the grid rows

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.GridView.dll

Syntax:

C#
public class GridViewRowCollection : IEnumerable, INotifyCollectionChanged

Inheritance: objectGridViewRowCollection

Implements: IEnumerableINotifyCollectionChanged

Constructors

Initializes a new instance of the GridViewRowCollection class.

C#
public GridViewRowCollection(GridViewTemplate owner)
Parameters:ownerGridViewTemplate

The owner.

Properties

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

C#
public int Count { get; }

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

C#
public bool IsReadOnly { get; }

Gets the owner.

C#
public GridViewTemplate Owner { get; }
Property Value:

The owner.

Gets or sets the GridViewRowInfo at the specified index.

C#
public GridViewRowInfo this[int index] { get; set; }
Parameters:indexint

Methods

Adds an item to the ICollection<T>.

C#
public void Add(GridViewRowInfo item)
Parameters:itemGridViewRowInfo

The object to add to the ICollection<T>.

Exceptions:

NotSupportedException

The ICollection<T> is read-only.

Adds a row to the collection

C#
public int Add(params object[] values)
Parameters:valuesobject[]

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

Returns:

int

The sorted index of the new row.

Adds a new row to the rows collection.

C#
public GridViewRowInfo AddNew()
Returns:

GridViewRowInfo

An instance GridViewRowInfo

Adds the range.

C#
public virtual void AddRange(params GridViewRowInfo[] rows)
Parameters:rowsGridViewRowInfo[]

The rows.

Removes all items from the ICollection<T>.

C#
public void Clear()
Exceptions:

NotSupportedException

The ICollection<T> is read-only.

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

C#
public bool Contains(GridViewRowInfo item)
Parameters:itemGridViewRowInfo

The object to locate in the ICollection<T>.

Returns:

bool

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

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

C#
public void CopyTo(GridViewRowInfo[] array, int arrayIndex)
Parameters:arrayGridViewRowInfo[]

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

arrayIndexint

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

Exceptions:

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

array 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.

Returns an enumerator that iterates through the collection.

C#
public IEnumerator<GridViewRowInfo> GetEnumerator()
Returns:

IEnumerator<GridViewRowInfo>

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

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

C#
public int IndexOf(GridViewRowInfo item)
Parameters:itemGridViewRowInfo

The object to locate in the IList<T>.

Returns:

int

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

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

C#
public void Insert(int index, GridViewRowInfo item)
Parameters:indexint

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

itemGridViewRowInfo

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.

Moves a specified row in unbound mode

C#
public void Move(int oldIndex, int newIndex)
Parameters:oldIndexint

The old index of the row.

newIndexint

The new index of the row.

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

C#
public GridViewRowInfo NewRow()
Returns:

GridViewRowInfo

Raises the event.

C#
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters:argsNotifyCollectionChangedEventArgs

The NotifyCollectionChangedEventArgs instance containing the event data.

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

C#
public bool Remove(GridViewRowInfo item)
Parameters:itemGridViewRowInfo

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.

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

C#
public void RemoveAt(int index)
Parameters:indexint

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

Occurs when the collection changes.

C#
public event NotifyCollectionChangedEventHandler CollectionChanged

Implements: INotifyCollectionChanged.CollectionChanged