# DataGridViewChildRowCollection

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [BaseCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.basecollection)
  * [DataGridViewChildRowCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewchildrowcollection)

Represents a collection of [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) objects that are childre of another [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow).

{% tabs %}
{% tab title="C#" %}

```csharp
public class DataGridViewChildRowCollection : BaseCollection, IList, IList<DataGridViewRow>, ICollection<DataGridViewRow>, IEnumerable<DataGridViewRow>
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DataGridViewChildRowCollection
    Inherits BaseCollection
    Implements IList, IList(Of DataGridViewRow), ICollection(Of DataGridViewRow), IEnumerable(Of DataGridViewRow)
```

{% endtab %}
{% endtabs %}

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(index)

[DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow): Returns the row at the specified index.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *index* is less than 0; or *index* is equal to or greater than the number of rows in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) List

[IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist):

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Contains(row)

Determines whether the specified row is contained in the collection.

| Parameter | Type                                                                                                           | Description                                                                                                                                                                                                                                                                             |
| --------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **row**   | [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) | The [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) to locate in the [DataGridViewSelectedRowCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewselectedrowcollection). |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if *row* is in the collection; otherwise, false.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CopyTo(array, index)

Copies the elements of the collection to the specified array, starting at the specified index.

| Parameter | Type                                                                                                               | Description                                                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| **array** | [DataGridViewRow\[\]](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) | The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                                        | The zero-based index in the array at which copying begins.                                                                             |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *array* is null.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *index* is less than zero.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) *array* is multidimensional; or the number of elements in the [DataGridViewCellCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellcollection) is greater than the available space from *index* to the end of *array* .
* [InvalidCastException](https://docs.microsoft.com/dotnet/api/system.invalidcastexception) The [DataGridViewCellCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellcollection) cannot be cast automatically to the type of *array* .

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndexOf(row)

Returns the index of the specified element.

| Parameter | Type                                                                                                           | Description                                                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **row**   | [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) | The [DataGridViewRow](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewrow) to locate in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index of the *row* parameter if it is found in the collection; otherwise, -1.
