DataGridViewRowCollection
Wisej.Web.DataGridViewRowCollection
Last updated
Was this helpful?
Wisej.Web.DataGridViewRowCollection
Last updated
Was this helpful?
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.
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.
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.
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.
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.
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.
Returns: Int32.
Returns: Int32.
Adds a DataGridViewRow row based on the DataGridViewRow at the specified index.
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.
Returns: Int32.
Returns: Int32.
Adds the specified DataGridViewRow objects to the collection.
newRows
An array of DataGridViewRow objects to be added to the DataGridViewRowCollection.
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:
Determines whether the specified DataGridViewRow is in the collection.
Returns: Boolean. true if the DataGridViewRow is in the DataGridViewRowCollection; otherwise, false.
Converts the virtual DataGridViewRow at index to a real row.
Copies the items from the collection into the specified DataGridViewRow array, starting at the specified index.
array
A DataGridViewRow array that is the destination of the items copied from the DataGridViewRowCollection.
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 .
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
The index of the row where the method should begin to look for the next DataGridViewRow.
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 .
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
The index of the row where the method should begin to look for the next DataGridViewRow.
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
The row where the method should begin to look for the previous DataGridViewRow.
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
The index of the row where the method should begin to look for the previous DataGridViewRow.
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
The row where the method should begin to look for the previous DataGridViewRow.
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
The index of the row where the method should begin to look for the previous DataGridViewRow.
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.
Returns: DataGridViewRow. An instance of DataGridViewRow.
Returns the number of rows that match the includeFilter .
includeFilter
A combination of the DataGridViewElementStates values for inclusion.
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 .
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.
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).
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).
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.
Returns: Int32. The index of the given DataGridViewRow.
Inserts a DataGridViewRow into the collection at the specified position.
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.
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.
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.
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.
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.
Returns: Int32.
Returns: Int32.
Inserts a new DataGridViewRow into the collection at the specified indexDestination , based on the DataGridViewRow at indexSource .
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.
Returns: Int32.
Returns: Int32.
Inserts the DataGridViewRow objects into the collection at the specified position.
newRows
An array of DataGridViewRow objects to add to the DataGridViewRowCollection.
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.
Returns: Boolean. A boolean indicating whether the cell is selected.
Returns whether the row as index is a virtual row.
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
One of CollectionChangeAction indicating the reason the collection has changed.
Removes the row from the collection.
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.
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.
Returns: Int32.
Removes the specified number of rows starting at the index.
Sets the state for the row at rowIndex .
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.
Returns: Boolean. A boolean indicating whether the selection has changed.
Sorts the data rows.
Returns the row index on the client, accounting for hidden rows.
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.
Returns: Int32.
Removes excess entries.
Returns: Int32.
CollectionChangeEventHandler Fired when the collection changes.
virtualRows
values
isNewRow
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
create
row
create
virtualRows
values
recreateNewRow