All pages
Powered by GitBook
1 of 1

Loading...

DataGridViewCellCollection

Wisej.Web.DataGridViewCellCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

  • BaseCollection

    • DataGridViewCellCollection

Represents a collection of cells in a DataGridViewRow.

Constructors

DataGridViewCellCollection(row)

Initializes a new instance of the class.

Name
Type
Description

Properties

Item(column)

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

Throws:

  • The specified value when setting this property is null; or column is null.

  • The specified cell when setting this property already belongs to a control, or the specified cell when setting this property already belongs to a

  • column is null.

Item(index)

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

Throws:

  • The specified value when setting this property is null.

  • The specified cell when setting this property already belongs to a control, or the specified cell when setting this property already belongs to a .

  • index is less than 0 or index is equal to or greater than the number of cells in the collection.

Item(columnName)

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

Throws:

  • columnName does not match the name of any columns in the control.

  • The specified value when setting this property is null; or columnName is null.

  • The specified cell when setting this property already belongs to a control, or the specified cell when setting this property already belongs to a .

List

: Returns the collection.

Methods

Add(cell)

Adds a cell to the collection.

Parameter
Type
Description

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

Throws:

  • The row that owns this already belongs to a control, or cell already belongs to a .

AddRange(cells)

Adds an array of cells to the collection.

Parameter
Type
Description

Throws:

  • cells is null.

  • The row that owns this already belongs to a control, or at least one value in cells is null, or at least one cell in cells already belongs to a , or at least two values in cells are references to the same .

AddRangeInternal(cells)

Adds an array of cells to the collection.

Parameter
Type
Description

Throws:

  • cells is null.

  • The row that owns this already belongs to a control, or at least one value in cells is null, or at least one cell in cells already belongs to a , or at least two values in cells are references to the same .

Clear()

Clears all cells from the collection.

Throws:

  • The row that owns this already belongs to a control.

Contains(cell)

Determines whether the specified cell is contained in the collection.

Parameter
Type
Description

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

CopyTo(array, index)

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

Parameter
Type
Description

IndexOf(cell)

Returns the index of the specified cell.

Parameter
Type
Description

Returns: . The zero-based index of the value of cell parameter, if it is found in the collection; otherwise, -1.

Insert(index, cell)

Inserts a cell into the collection at the specified index.

Parameter
Type
Description

Throws:

  • The row that owns this already belongs to a control, or cell already belongs to a .

OnCollectionChanged(action, element)

Fires the event.

Parameter
Type
Description

Remove(cell)

Removes the specified cell from the collection.

Parameter
Type
Description

Throws:

  • The row that owns this already belongs to a control.

  • cell could not be found in the collection.

RemoveAt(index)

Removes the cell at the specified index.

Parameter
Type
Description

Throws:

  • The row that owns this already belongs to a control.

Events

CollectionChanged

Fired when the collection changes.

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.

  • row

    DataGridViewRow

    The DataGridViewRow that owns the collection.

    cell

    DataGridViewCell

    A DataGridViewCell to add to the collection.

    cells

    DataGridViewCell[]

    The array of DataGridViewCell objects to add to the collection.

    cells

    DataGridViewCell[]

    The array of DataGridViewCell objects to add to the collection.

    cell

    DataGridViewCell

    A DataGridViewCell to locate in the collection.

    array

    DataGridViewCell[]

    The destination array to which the contents will be copied.

    index

    Int32

    The index of the element in array at which to start copying.

    cell

    DataGridViewCell

    The cell to locate in the collection.

    index

    Int32

    The zero-based index at which to place cell .

    cell

    DataGridViewCell

    The DataGridViewCell to insert.

    action

    CollectionChangeAction

    One of CollectionChangeAction indicating the reason the collection has changed.

    element

    Object

    The element that was added or removed from the collection, or null.

    cell

    DataGridViewCell

    The DataGridViewCell to remove from the collection.

    index

    Int32

    The zero-based index of the DataGridViewCell to be removed.

    Public Class DataGridViewCellCollection
        Inherits BaseCollection
        Implements IList, IList(Of DataGridViewCell), ICollection(Of DataGridViewCell), IEnumerable(Of DataGridViewCell)
    DataGridViewCellCollection
    DataGridViewCell
    ArgumentNullException
    InvalidOperationException
    DataGridView
    DataGridViewRow
    ArgumentNullException
    DataGridViewCell
    ArgumentNullException
    InvalidOperationException
    DataGridView
    DataGridViewRow
    ArgumentOutOfRangeException
    DataGridViewCell
    ArgumentException
    ArgumentNullException
    InvalidOperationException
    DataGridView
    DataGridViewRow
    IList
    Int32
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    DataGridViewRow
    ArgumentNullException
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    DataGridViewRow
    DataGridViewCell
    ArgumentNullException
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    DataGridViewRow
    DataGridViewCell
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    Boolean
    Int32
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    DataGridViewRow
    CollectionChanged
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    ArgumentException
    InvalidOperationException
    DataGridViewCellCollection
    DataGridView
    CollectionChangeEventHandler
    public class DataGridViewCellCollection : BaseCollection, IList, IList<DataGridViewCell>, ICollection<DataGridViewCell>, IEnumerable<DataGridViewCell>