DataGridViewRowCollection

Wisej.Web.DataGridViewRowCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (2.5.0.0)

A collection of DataGridViewRow objects.

public class DataGridViewRowCollection : IList, ICollection, IEnumerable, IList<DataGridViewRow>, ICollection<DataGridViewRow>, IEnumerable<DataGridViewRow>

Constructors

DataGridViewRowCollection(dataGrid)

Initializes a new instance of the DataGridViewRowCollection class for the given DataGridView.

Name
Type
Description

dataGrid

The DataGridView that created this collection.

Properties

Count

Int32: Returns the number of rows in the collection.

Item(index)

DataGridViewRow: Returns the DataGridViewRow at the specified index.

Throws:

Methods

Add()

Adds a new DataGridViewRow to the collection.

Returns: Int32. The index of the new DataGridViewRow.

Throws:

Add(values)

Adds a new DataGridViewRow to the collection, and populates the cells with the specified objects.

Parameter
Type
Description

values

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

Returns: Int32. The index of the new DataGridViewRow.

Throws:

Add(row)

Adds the specified DataGridViewRow to the collection.

Parameter
Type
Description

Returns: Int32. The index of the new DataGridViewRow.

Throws:

Add(count)

Adds the specified number of new rows to the collection.

Parameter
Type
Description

count

The number of rows to add to the DataGridViewRowCollection.

Returns: Int32. The index of the last row that was added.

Throws:

AddCopies(rowIndex, count)

Adds the specified number of rows to the collection based on the row at the specified index.

Parameter
Type
Description

rowIndex

The index of the row on which to base the new rows.

count

The number of rows to add to the DataGridViewRowCollection.

Returns: Int32. The index of the last row that was added.

Throws:

AddCopy(rowIndex)

Adds a DataGridViewRow row based on the DataGridViewRow at the specified index.

Parameter
Type
Description

rowIndex

The index of the row on which to base the new row.

Returns: Int32. The index of the new DataGridViewRow.

Throws:

AddRange(newRows)

Adds the specified DataGridViewRow objects to the collection.

Parameter
Type
Description

newRows

An array of DataGridViewRow objects to be added to the DataGridViewRowCollection.

Throws:

Clear()

Clears the collection.

Throws:

Contains(row)

Determines whether the specified DataGridViewRow is in the collection.

Parameter
Type
Description

Returns: Boolean. true if the DataGridViewRow is in the DataGridViewRowCollection; otherwise, false.

CopyTo(array, index)

Copies the items from the collection into the specified DataGridViewRow array, starting at the specified index.

Parameter
Type
Description

array

A DataGridViewRow array that is the destination of the items copied from the DataGridViewRowCollection.

index

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

Throws:

GetFirstRow(includeFilter, excludeFilter)

Returns the first DataGridViewRow that matches the specified includeFilter and excludeFilter .

Parameter
Type
Description

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The first DataGridViewRow that matches the specified filters; or null if no row is found.

Throws:

GetFirstRowIndex(includeFilter, excludeFilter)

Returns the index of the first DataGridViewRow that matches the specified includeFilter and excludeFilter .

Parameter
Type
Description

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of the first DataGridViewRow that matches the specified filters; or -1 if no row is found.

Throws:

GetLastRow(includeFilter, excludeFilter)

Returns the last DataGridViewRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The last DataGridViewRow that matches the specified filter; or null if no row is found.

Throws:

GetLastRowIndex(includeFilter, excludeFilter)

Returns the index of the last DataGridViewRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of the last DataGridViewRow that matches the specified filter; or -1 if no row is found.

Throws:

GetNextRow(startRow, includeFilter, excludeFilter)

Returns the next DataGridViewRow after startRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startRow

The row where the method should begin to look for the next DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The next DataGridViewRow that matches the filters; or null if no row is found after startRow .

Throws:

GetNextRow(startIndex, includeFilter, excludeFilter)

Returns the next DataGridViewRow after startIndex that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startIndex

The index of the row where the method should begin to look for the next DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The next DataGridViewRow that matches the filters; or null if no row is found after startIndex .

Throws:

GetNextRowIndex(startRow, includeFilter, excludeFilter)

Returns the index of the next DataGridViewRow after startRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startRow

The row where the method should begin to look for the next DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of the next DataGridViewRow that matches the filters; or -1 if no row is found after startRow .

Throws:

GetNextRowIndex(startIndex, includeFilter, excludeFilter)

Returns the index of the next DataGridViewRow after startIndex that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startIndex

The index of the row where the method should begin to look for the next DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of the next DataGridViewRow that matches the filters; or -1 if no row is found after startIndex .

Throws:

GetPreviousRow(startRow, includeFilter, excludeFilter)

Returns the previous DataGridViewRow before startRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startRow

The row where the method should begin to look for the previous DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The previous DataGridViewRow that matches the filters; or null if no row is found before startRow .

Throws:

GetPreviousRow(startIndex, includeFilter, excludeFilter)

Returns the previous DataGridViewRow before startIndex that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startIndex

The index of the row where the method should begin to look for the previous DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: DataGridViewRow. The previous DataGridViewRow that matches the filters; or null if no row is found before startIndex .

Throws:

GetPreviousRowIndex(startRow, includeFilter, excludeFilter)

Returns the index of the previous DataGridViewRow before startRow that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startRow

The row where the method should begin to look for the previous DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of previous DataGridViewRow that matches the filters; or -1 if no row is found before startRow .

Throws:

GetPreviousRowIndex(startIndex, includeFilter, excludeFilter)

Returns the index of the previous DataGridViewRow before startIndex that matches the includeFilter and excludeFilter .

Parameter
Type
Description

startIndex

The index of the row where the method should begin to look for the previous DataGridViewRow.

includeFilter

A bitwise combination of DataGridViewElementStates values.

excludeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The index of the previous DataGridViewRow that matches the filters; or -1 if no row is found before startIndex .

Throws:

GetRowCount(includeFilter)

Returns the number of rows that match the includeFilter .

Parameter
Type
Description

includeFilter

A combination of the DataGridViewElementStates values for inclusion.

Returns: Int32. The number of rows that match the includeFilter .

Throws:

GetRowsHeight(includeFilter)

Returns the cumulative height of the DataGridViewRow objects that match the includeFilter .

Parameter
Type
Description

includeFilter

A bitwise combination of DataGridViewElementStates values.

Returns: Int32. The cumulative height of DataGridViewRow objects that match the includeFilter .

Throws:

GetRowState(rowIndex)

Returns the state of the DataGridViewRow at the specified index.

Parameter
Type
Description

rowIndex

The index of the row.

Returns: DataGridViewElementStates. A combination of DataGridViewElementStates values indicating the state of the row.

Throws:

IndexOf(row)

Returns the index of the given DataGridViewRow in the collection.

Parameter
Type
Description

row

The DataGridViewRow to return the index of.

Returns: Int32. The index of the given DataGridViewRow.

Insert(index)

Inserts a DataGridViewRow into the collection at the specified position.

Parameter
Type
Description

index

The position at which to insert the DataGridViewRow.

Throws:

Insert(index, values)

Inserts a DataGridViewRow into the collection at the specified position, and populates the cells with the specified objects.

Parameter
Type
Description

index

The position at which to insert the DataGridViewRow.

values

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

Throws:

Insert(index, row)

Inserts the specified DataGridViewRow into the collection.

Parameter
Type
Description

index

The position at which to insert the row.

Throws:

Insert(index, count)

Inserts the specified number of rows into the collection at the specified location.

Parameter
Type
Description

index

The position at which to insert the rows.

count

The number of rows to insert into the DataGridViewRowCollection.

Throws:

InsertCopies(indexSource, indexDestination, count)

Inserts rows into the collection at the specified position.

Parameter
Type
Description

indexSource

The index of the DataGridViewRow on which to base the new rows.

indexDestination

The position at which to insert the rows.

count

The number of DataGridViewRow objects to add to the DataGridViewRowCollection.

Throws:

InsertCopy(indexSource, indexDestination)

Inserts a new DataGridViewRow into the collection at the specified indexDestination , based on the DataGridViewRow at indexSource .

Parameter
Type
Description

indexSource

The index of the DataGridViewRow on which to base the new DataGridViewRow.

indexDestination

The position at which to insert the row.

Throws:

InsertRange(index, newRows)

Inserts the DataGridViewRow objects into the collection at the specified position.

Parameter
Type
Description

index

The position at which to insert the rows.

newRows

An array of DataGridViewRow objects to add to the DataGridViewRowCollection.

Throws:

Remove(row)

Removes the row from the collection.

Parameter
Type
Description

row

The row to remove from the DataGridViewRowCollection.

Throws:

RemoveAt(index)

Removes the DataGridViewRow at the specified position from the collection.

Parameter
Type
Description

index

The position of the row to remove.

Throws:

SetRowState(rowIndex, state)

Sets the state for the row at rowIndex .

Parameter
Type
Description

rowIndex

The index of the row.

Throws:

Events

CollectionChanged

CollectionChangeEventHandler Fired when the collection changes.

Last updated