Skip to main content
Version: 4.1

DataGridViewCellCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a collection of cells in a DataGridViewRow.

public class DataGridViewCellCollection : BaseCollection, IList, IList<DataGridViewCell>, ICollection<DataGridViewCell>, IEnumerable<DataGridViewCell>

Constructors

Instance member DataGridViewCellCollection(row)

Initializes a new instance of the DataGridViewCellCollection class.

NameTypeDescription
rowDataGridViewRowThe DataGridViewRow that owns the collection.

Properties

Instance member Item(column)

DataGridViewCell: Returns or sets the cell contained in the specified column .

Throws:

Instance member Item(index)

DataGridViewCell: Returns or sets the cell at the provided index location.

Throws:

Instance member Item(columnName)

DataGridViewCell: Returns or sets the cell in the column with the provided name.

Throws:

Instance member List

IList: Returns the collection.

Methods

Instance member Add(cell)

Adds a cell to the collection.

ParameterTypeDescription
cellDataGridViewCellA DataGridViewCell to add to the collection.

Returns: Int32. The position in which to insert the new element.

Throws:

Instance member AddRange(cells)

Adds an array of cells to the collection.

ParameterTypeDescription
cellsDataGridViewCell[]The array of DataGridViewCell objects to add to the collection.

Throws:

Instance member AddRangeInternal(cells)

Adds an array of cells to the collection.

ParameterTypeDescription
cellsDataGridViewCell[]The array of DataGridViewCell objects to add to the collection.

Throws:

Instance member Clear()

Clears all cells from the collection.

Throws:

Instance member Contains(cell)

Determines whether the specified cell is contained in the collection.

ParameterTypeDescription
cellDataGridViewCellA DataGridViewCell to locate in the collection.

Returns: Boolean. true if cell is in the collection; otherwise, false.

Instance member CopyTo(array, index)

Copies the entire collection of cells into an array at a specified location within the array.

ParameterTypeDescription
arrayDataGridViewCell[]The destination array to which the contents will be copied.
indexInt32The index of the element in array at which to start copying.

Instance member IndexOf(cell)

Returns the index of the specified cell.

ParameterTypeDescription
cellDataGridViewCellThe 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.

Instance member Insert(index, cell)

Inserts a cell into the collection at the specified index.

ParameterTypeDescription
indexInt32The zero-based index at which to place cell .
cellDataGridViewCellThe DataGridViewCell to insert.

Throws:

Protected member OnCollectionChanged(action, element)

Fires the CollectionChanged event.

ParameterTypeDescription
actionCollectionChangeActionOne of CollectionChangeAction indicating the reason the collection has changed.
elementObjectThe element that was added or removed from the collection, or null.

Instance member Remove(cell)

Removes the specified cell from the collection.

ParameterTypeDescription
cellDataGridViewCellThe DataGridViewCell to remove from the collection.

Throws:

Instance member RemoveAt(index)

Removes the cell at the specified index.

ParameterTypeDescription
indexInt32The zero-based index of the DataGridViewCell to be removed.

Throws:

Events

Instance member CollectionChanged

CollectionChangeEventHandler Fired when the collection changes.