DataGridViewCellCollection
Wisej.Web.DataGridViewCellCollection
Last updated
Wisej.Web.DataGridViewCellCollection
Last updated
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Represents a collection of cells in a DataGridViewRow.
Initializes a new instance of the DataGridViewCellCollection class.
Name | Type | Description |
---|---|---|
row | The DataGridViewRow that owns the collection. |
DataGridViewCell: Returns or sets the cell contained in the specified column .
Throws:
ArgumentNullException The specified value when setting this property is null; or column is null.
InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow
ArgumentNullException column is null.
ArgumentException The specified column does not belong to the same DataGridView that owns the cells.
ArgumentOutOfRangeException The index of the specified column is less than 0 or is equal to or greater than the number of cells in the collection.
DataGridViewCell: Returns or sets the cell at the provided index location.
Throws:
ArgumentNullException The specified value when setting this property is null.
InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow.
ArgumentOutOfRangeException index is less than 0 or index is equal to or greater than the number of cells in the collection.
DataGridViewCell: Returns or sets the cell in the column with the provided name.
Throws:
ArgumentException columnName does not match the name of any columns in the control.
ArgumentNullException The specified value when setting this property is null; or columnName is null.
InvalidOperationException The specified cell when setting this property already belongs to a DataGridView control, or the specified cell when setting this property already belongs to a DataGridViewRow.
Adds a cell to the collection.
Parameter | Type | Description |
---|---|---|
cell | A DataGridViewCell to add to the collection. |
Returns: Int32. The position in which to insert the new element.
Throws:
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control, or cell already belongs to a DataGridViewRow.
Adds an array of cells to the collection.
Parameter | Type | Description |
---|---|---|
cells | The array of DataGridViewCell objects to add to the collection. |
Throws:
ArgumentNullException cells is null.
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control, or at least one value in cells is null, or at least one cell in cells already belongs to a DataGridViewRow, or at least two values in cells are references to the same DataGridViewCell.
Adds an array of cells to the collection.
Parameter | Type | Description |
---|---|---|
cells | The array of DataGridViewCell objects to add to the collection. |
Throws:
ArgumentNullException cells is null.
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control, or at least one value in cells is null, or at least one cell in cells already belongs to a DataGridViewRow, or at least two values in cells are references to the same DataGridViewCell.
Clears all cells from the collection.
Throws:
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control.
Determines whether the specified cell is contained in the collection.
Parameter | Type | Description |
---|---|---|
cell | A DataGridViewCell to locate in the collection. |
Returns: Boolean. true if cell is in the collection; otherwise, false.
Copies the entire collection of cells into an array at a specified location within the array.
Parameter | Type | Description |
---|---|---|
array | The destination array to which the contents will be copied. | |
index | The index of the element in array at which to start copying. |
Returns the index of the specified cell.
Parameter | Type | Description |
---|---|---|
cell | The cell to locate in the collection. |
Returns: Int32. The zero-based index of the value of cell parameter, if it is found in the collection; otherwise, -1.
Inserts a cell into the collection at the specified index.
Parameter | Type | Description |
---|---|---|
index | The zero-based index at which to place cell . | |
cell | The DataGridViewCell to insert. |
Throws:
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control, or cell already belongs to a DataGridViewRow.
Removes the specified cell from the collection.
Parameter | Type | Description |
---|---|---|
cell | The DataGridViewCell to remove from the collection. |
Throws:
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control.
ArgumentException cell could not be found in the collection.
Removes the cell at the specified index.
Parameter | Type | Description |
---|---|---|
index | The zero-based index of the DataGridViewCell to be removed. |
Throws:
InvalidOperationException The row that owns this DataGridViewCellCollection already belongs to a DataGridView control.
CollectionChangeEventHandler Fired when the collection changes.