Wisej.Web.DataGridViewRowCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.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.
SynchronizedLinkedList<Point>: Returns the collection of all selected cells.
Int32: Returns the total count of visible rows.
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:
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:
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:
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:
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:
RowValidating Or the DataSource property of the DataGridView is not null.
rowTemplate
count
Returns: Int32.
index
count
Returns: Int32.
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:
RowValidating Or the DataSource property of the DataGridView is not null.
row
bulk
isNewRow
Returns: Int32.
Returns: Int32.
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:
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:
recreateNewRow
Determines whether the specified DataGridViewRow is in the collection.
row
Returns: Boolean. true if the DataGridViewRow is in the DataGridViewRowCollection; otherwise, false.
Converts the virtual DataGridViewRow at index to a real row.
index
Index of the row to convert.
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 .
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 .
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 .
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 .
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
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
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
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
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
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
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
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
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 DataGridViewRow at the specified index ; creates the row if it has never been created.
index
Index of the row to return.
Returns: DataGridViewRow. An instance of DataGridViewRow.
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 DataGridViewRow at the specified index if the row has been created; otherwise it returns a temporary row that can only be used internally and is not rooted (will be garbage collected).
index
Index of the row to return.
True to create the virtual row if it doesn't exit, otherwise false to return null if the virtual row was never created.
Returns: DataGridViewRow. An instance of DataGridViewRow.
Returns the DataGridViewRow at the specified index if the row has been created; otherwise it returns a temporary row that can only be used internally and is not rooted (will be garbage collected).
index
Index of the row to return.
Reusable virtual row. If the specified row is a virtual row, it will be updated and reused.
True to create the virtual row if it doesn't exit, otherwise false to return null if the virtual row was never created.
Returns: DataGridViewRow. An instance of DataGridViewRow. If it's a virtual row it is the same as row . If it's a real row it will be different than row .
Returns whether there are hierarchical rows in the collection.
Returns: Boolean.
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:
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:
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:
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:
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:
RowValidating Or the DataSource property of the DataGridView is not null.
rowTemplate
index
count
Returns: Int32.
indexSource
indexDestination
count
Returns: Int32.
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:
RowValidating Or the DataSource property of the DataGridView is not null.
index
row
bulk
Returns: Int32.
index
Returns: Int32.
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:
RowValidating Or the DataSource property of the DataGridView is not null.
Returns whether the specified cell is selected.
colIndex
Column index of the cell. -1 to check any cell in the row.
rowIndex
Row index of the cell.
Returns: Boolean. A boolean indicating whether the cell is selected.
Returns whether the row as index is a virtual row.
index
Index of the row to check.
Returns: Boolean. True if the DataGridViewRow at index is a virtual row whether is has been created yet or not.
Fires the CollectionChanged event.
action
element
The element that was added or removed from the collection, or null.
Indicates whether the grid should re-create the new automatic row.
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:
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:
Or the DataSource property of the DataGridView is not null. Or the DataGridView has no columns.
index
bulk
Returns: Int32.
Removes the specified number of rows starting at the index.
index
The index of the first row to remove.
count
The number of rows to remove.
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.
Sets the selected state of this specified cell.
colIndex
Column index of the cell.
rowIndex
Row index of the cell.
selected
Selected state of the cell.
Returns: Boolean. A boolean indicating whether the selection has changed.
Sorts the data rows.
comparer
Row comparer.
ascending
Sort direction.
Returns the row index on the client, accounting for hidden rows.
index
The row index to convert to the client row index.
Returns: Int32.
Translates the visible row index (the index on the client) to the real row index in the row collection, accounting for the invisible rows.
row
The row index to translate to the corresponding server side row index.
Returns: Int32.
Removes excess entries.
rowIndex
rowCount
rowChangingState
Returns: Int32.
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 .
virtualRows
values
isNewRow
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 .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The row where the method should begin to look for the next .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The index of the row where the method should begin to look for the next .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The row where the method should begin to look for the next .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The index of the row where the method should begin to look for the next .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The row where the method should begin to look for the previous .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The index of the row where the method should begin to look for the previous .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The row where the method should begin to look for the previous .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
The index of the row where the method should begin to look for the previous .
includeFilter
A bitwise combination of values.
excludeFilter
A bitwise combination of values.
A combination of the values for inclusion.
A bitwise combination of values.
create
row
create
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 .
virtualRows
The index of the on which to base the new .
values
An array of objects to add to the .
One of indicating the reason the collection has changed.
recreateNewRow
The row to remove from the .
state to set.