Wisej.Web.DataGridViewRowCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.0.0.0)
A collection of DataGridViewRow objects.
Initializes a new instance of the DataGridViewRowCollection class for the given DataGridView.
dataGrid
Int32: Returns the number of rows in the collection.
DataGridViewRow: Returns the DataGridViewRow at the specified index.
Throws:
ArgumentOutOfRangeException index is less than 0.- or - index is equal to or greater than Count.
Adds a new DataGridViewRow to the collection.
Returns: Int32. The index of the new DataGridViewRow.
Throws:
ArgumentException The row returned by the RowTemplate property has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Adds a new DataGridViewRow to the collection, and populates the cells with the specified objects.
values
Returns: Int32. The index of the new DataGridViewRow.
Throws:
ArgumentNullException values is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns. Or the VirtualMode property of the DataGridView is set to true. Or the row returned by the RowTemplate property has more cells than there are columns in the control.
Adds the specified DataGridViewRow to the collection.
row
Returns: Int32. The index of the new DataGridViewRow.
Throws:
ArgumentNullException row is null.
ArgumentException row has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Adds the specified number of new rows to the collection.
count
Returns: Int32. The index of the last row that was added.
Throws:
ArgumentOutOfRangeException count is less than 1.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Adds the specified number of rows to the collection based on the row at the specified index.
rowIndex
The index of the row on which to base the new rows.
count
Returns: Int32. The index of the last row that was added.
Throws:
ArgumentOutOfRangeException rowIndex is less than zero or greater than or equal to the number of rows in the control; or count is less than zero.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Adds a DataGridViewRow row based on the DataGridViewRow at the specified index.
rowIndex
The index of the row on which to base the new row.
Returns: Int32. The index of the new DataGridViewRow.
Throws:
ArgumentOutOfRangeException rowIndex is less than zero or greater than or equal to the number of rows in the collection.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Adds the specified DataGridViewRow objects to the collection.
newRows
Throws:
ArgumentNullException newRows is null.
ArgumentException newRows contains only one row, and the row it contains has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Clears the collection.
Throws:
InvalidOperationException The collection is data bound and the underlying data source does not support clearing the row data. Or the associated DataGridView control is performing one of the following actions that temporarily prevents the row collection from being modified: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Determines whether the specified DataGridViewRow is in the collection.
row
Returns: Boolean. true if the DataGridViewRow is in the DataGridViewRowCollection; otherwise, false.
Copies the items from the collection into the specified DataGridViewRow array, starting at the specified index.
array
index
The zero-based index in array at which copying begins.
Throws:
ArgumentNullException array is null.
ArgumentOutOfRangeException index is less than zero.
ArgumentException array is multidimensional; or the number of elements in the DataGridViewRowCollection is greater than the available space from index to the end of array .
Returns the first DataGridViewRow that matches the specified includeFilter and excludeFilter .
includeFilter
excludeFilter
Returns: DataGridViewRow. The first DataGridViewRow that matches the specified filters; or null if no row is found.
Throws:
ArgumentException One or both of the specified filter values is not a valid combination of DataGridViewElementStates values.
Returns the index of the first DataGridViewRow that matches the specified includeFilter and excludeFilter .
includeFilter
excludeFilter
Returns: Int32. The index of the first DataGridViewRow that matches the specified filters; or -1 if no row is found.
Throws:
ArgumentException One or both of the specified filter values is not a valid combination of DataGridViewElementStates values.
Returns the last DataGridViewRow that matches the includeFilter and excludeFilter .
includeFilter
excludeFilter
Returns: DataGridViewRow. The last DataGridViewRow that matches the specified filter; or null if no row is found.
Throws:
ArgumentException includeFilter is not a valid bitwise combination of DataGridViewElementStates values.
Returns the index of the last DataGridViewRow that matches the includeFilter and excludeFilter .
includeFilter
excludeFilter
Returns: Int32. The index of the last DataGridViewRow that matches the specified filter; or -1 if no row is found.
Throws:
ArgumentException includeFilter is not a valid bitwise combination of DataGridViewElementStates values.
Returns the next DataGridViewRow after startRow that matches the includeFilter and excludeFilter .
startRow
includeFilter
excludeFilter
Returns: DataGridViewRow. The next DataGridViewRow that matches the filters; or null if no row is found after startRow .
Throws:
ArgumentNullException startRow is null.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the next DataGridViewRow after startIndex that matches the includeFilter and excludeFilter .
startIndex
includeFilter
excludeFilter
Returns: DataGridViewRow. The next DataGridViewRow that matches the filters; or null if no row is found after startIndex .
Throws:
ArgumentOutOfRangeException startIndex is less than -1.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the index of the next DataGridViewRow after startRow that matches the includeFilter and excludeFilter .
startRow
includeFilter
excludeFilter
Returns: Int32. The index of the next DataGridViewRow that matches the filters; or -1 if no row is found after startRow .
Throws:
ArgumentNullException startRow is null.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the index of the next DataGridViewRow after startIndex that matches the includeFilter and excludeFilter .
startIndex
includeFilter
excludeFilter
Returns: Int32. The index of the next DataGridViewRow that matches the filters; or -1 if no row is found after startIndex .
Throws:
ArgumentOutOfRangeException startIndex is less than -1.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the previous DataGridViewRow before startRow that matches the includeFilter and excludeFilter .
startRow
includeFilter
excludeFilter
Returns: DataGridViewRow. The previous DataGridViewRow that matches the filters; or null if no row is found before startRow .
Throws:
ArgumentNullException startRow is null.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the previous DataGridViewRow before startIndex that matches the includeFilter and excludeFilter .
startIndex
includeFilter
excludeFilter
Returns: DataGridViewRow. The previous DataGridViewRow that matches the filters; or null if no row is found before startIndex .
Throws:
ArgumentOutOfRangeException startIndex is greater than the number of rows in the collection.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the index of the previous DataGridViewRow before startRow that matches the includeFilter and excludeFilter .
startRow
includeFilter
excludeFilter
Returns: Int32. The index of previous DataGridViewRow that matches the filters; or -1 if no row is found before startRow .
Throws:
ArgumentNullException startRow is null.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the index of the previous DataGridViewRow before startIndex that matches the includeFilter and excludeFilter .
startIndex
includeFilter
excludeFilter
Returns: Int32. The index of the previous DataGridViewRow that matches the filters; or -1 if no row is found before startIndex .
Throws:
ArgumentOutOfRangeException startIndex is greater than the number of rows in the collection.
ArgumentException One or both of the specified filter values is not a valid bitwise combination of DataGridViewElementStates values.
Returns the number of rows that match the includeFilter .
includeFilter
Returns: Int32. The number of rows that match the includeFilter .
Throws:
ArgumentException includeFilter is not a valid bitwise combination of DataGridViewElementStates values.
Returns the cumulative height of the DataGridViewRow objects that match the includeFilter .
includeFilter
Returns: Int32. The cumulative height of DataGridViewRow objects that match the includeFilter .
Throws:
ArgumentException includeFilter is not a valid bitwise combination of DataGridViewElementStates values.
Returns the state of the DataGridViewRow at the specified index.
rowIndex
The index of the row.
Returns: DataGridViewElementStates. A combination of DataGridViewElementStates values indicating the state of the row.
Throws:
ArgumentOutOfRangeException rowIndex is less than zero and greater than the number of rows in the collection.
Returns the index of the given DataGridViewRow in the collection.
row
Returns: Int32. The index of the given DataGridViewRow.
Inserts a DataGridViewRow into the collection at the specified position.
index
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of rows in the collection.
ArgumentException The row returned by the control's RowTemplate property has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns. Or the VirtualMode property of the DataGridView is set to true. Or the row returned by the RowTemplate property has more cells than there are columns in the control.
Inserts a DataGridViewRow into the collection at the specified position, and populates the cells with the specified objects.
index
values
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of rows in the collection.
ArgumentNullException values is null.
ArgumentException The row returned by the control's RowTemplate property has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns. Or the VirtualMode property of the DataGridView is set to true. Or the row returned by the RowTemplate property has more cells than there are columns in the control.
Inserts the specified DataGridViewRow into the collection.
index
The position at which to insert the row.
row
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of rows in the collection.
ArgumentNullException row is null.
ArgumentException row has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Inserts the specified number of rows into the collection at the specified location.
index
The position at which to insert the rows.
count
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of rows in the collection. or count is less than 1.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Inserts rows into the collection at the specified position.
indexSource
indexDestination
The position at which to insert the rows.
count
Throws:
ArgumentOutOfRangeException indexSource is less than zero or greater than the number of rows in the collection minus one; or indexDestination is less than zero or greater than the number of rows in the collection; or count is less than 1.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Inserts a new DataGridViewRow into the collection at the specified indexDestination , based on the DataGridViewRow at indexSource .
indexSource
indexDestination
The position at which to insert the row.
Throws:
ArgumentOutOfRangeException indexSource is less than zero or greater than the number of rows in the collection minus one; or indexDestination is less than zero or greater than the number of rows in the collection.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Inserts the DataGridViewRow objects into the collection at the specified position.
index
The position at which to insert the rows.
newRows
Throws:
ArgumentNullException newRows is null.
ArgumentOutOfRangeException index is less than zero or greater than the number of rows in the collection.
ArgumentException newRows contains only one row, and the row it contains has more cells than there are columns in the control.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null.
Removes the row from the collection.
row
Throws:
ArgumentNullException row is null.
ArgumentException row is not contained in this collection; or row is a shared row.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Removes the DataGridViewRow at the specified position from the collection.
index
The position of the row to remove.
Throws:
ArgumentOutOfRangeException index is less than zero and greater than the number of rows in the collection minus one.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new rows from being added: - Selecting all cells in the control. - Clearing the selection. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
Sets the state for the row at rowIndex .
rowIndex
The index of the row.
state
Throws:
ArgumentOutOfRangeException rowIndex is less than zero and greater than the number of rows in the collection.
CollectionChangeEventHandler Fired when the collection changes.
The that created this collection.
A variable number of objects that populate the cells of the new .
The to add to the .
The number of rows to add to the .
The number of rows to add to the .
An array of objects to be added to the .
The to locate in the .
A array that is the destination of the items copied from the .
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
A bitwise combination of values.
The row where the method should begin to look for the next .
A bitwise combination of values.
A bitwise combination of values.
The index of the row where the method should begin to look for the next .
A bitwise combination of values.
A bitwise combination of values.
The row where the method should begin to look for the next .
A bitwise combination of values.
A bitwise combination of values.
The index of the row where the method should begin to look for the next .
A bitwise combination of values.
A bitwise combination of values.
The row where the method should begin to look for the previous .
A bitwise combination of values.
A bitwise combination of values.
The index of the row where the method should begin to look for the previous .
A bitwise combination of values.
A bitwise combination of values.
The row where the method should begin to look for the previous .
A bitwise combination of values.
A bitwise combination of values.
The index of the row where the method should begin to look for the previous .
A bitwise combination of values.
A bitwise combination of values.
A combination of the values for inclusion.
A bitwise combination of values.
The to return the index of.
The position at which to insert the .
The position at which to insert the .
A variable number of objects that populate the cells of the new .
The to insert into the .
The number of rows to insert into the .
The index of the on which to base the new rows.
The number of objects to add to the .
The index of the on which to base the new .
An array of objects to add to the .
The row to remove from the .
state to set.