Wisej.Web.DataGridViewColumnCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.2.0.0)
Represents a collection of DataGridViewColumn objects in a DataGridView control.
Initializes a new instance of the DataGridViewColumnCollection class for the given DataGridView.
Name | Type | Description |
---|---|---|
DataGridViewColumn: Returns the column at the given index in the collection.
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of columns in the collection minus one.
DataGridViewColumn: Returns the column of the given name in the collection.
Throws:
ArgumentNullException name is null.
Adds the given DataGridViewColumn to the collection.
Returns: Int32. The index of the column.
Throws:
ArgumentNullException column is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Adds a DataGridViewTextBoxColumn with the given column name to the collection.
Returns: Int32. The index of the column.
Throws:
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Adds a DataGridViewTextBoxColumn with the given column name and call value type to the collection.
Returns: Int32. The index of the column.
Throws:
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Adds a DataGridViewTextBoxColumn with the given column name and column header text to the collection.
Returns: Int32. The index of the column.
Throws:
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Adds a DataGridViewTextBoxColumn with the given column name, column header text, and cell value type to the collection.
Returns: Int32. The index of the column.
Throws:
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Adds a range of columns to the collection.
Throws:
ArgumentNullException newColumns is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Clears the collection.
Throws:
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Clears the collection and disposes the columns.
Determines whether the collection contains the given DataGridViewColumn.
Returns: Boolean. true if the given column is in the collection; otherwise, false.
Determines whether the collection contains the given DataGridViewColumn.
Returns: Boolean. true if the given column is in the collection; otherwise, false.
Copies the items from the collection to the given array.
Returns the number of columns that match the includeFilter .
Returns: Int32. The number of columns that match the filter.
Throws:
ArgumentException includeFilter is not a valid combination of DataGridViewElementStates values.
Returns the width, in pixels, required to display all of the columns that meet the includeFilter .
Returns: Int32. The width, in pixels, that is necessary to display all of the columns that match the filter.
Throws:
ArgumentException includeFilter is not a valid combination of DataGridViewElementStates values.
Returns the first DataGridViewColumn in display order that matches the includeFilter and excludeFilter .
Returns: DataGridViewColumn. The first DataGridViewColumn in display order that matches the given filters, or null if no column is found.
Throws:
ArgumentException At least one of the filter values is not a valid combination of DataGridViewElementStates values.
Returns the last DataGridViewColumn in display order that matches the includeFilter and excludeFilter .
Returns: DataGridViewColumn. The last displayed DataGridViewColumn in display order that matches the specified filters, or null if no column is found.
Throws:
ArgumentException At least one of the filter values is not a valid combination of DataGridViewElementStates values.
Returns the first DataGridViewColumn after the given column in display order that matches the includeFilter and excludeFilter .
Returns: DataGridViewColumn. The next DataGridViewColumn that matches the filters, or null if no column is found.
Throws:
ArgumentNullException startColumn is null.
ArgumentException At least one of the filter values is not a valid combination of DataGridViewElementStates values.
Returns the last DataGridViewColumn prior to the given column in display order that matches the includeFilter and excludeFilter .
Returns: DataGridViewColumn. The previous column that matches the given filters, or null if no column is found.
Throws:
ArgumentNullException startColumn is null.
ArgumentException At least one of the filter values is not a valid combination of DataGridViewElementStates values.
Returns the index of the given DataGridViewColumn in the collection.
Returns: Int32. The index of the given DataGridViewColumn.
Returns the index of the DataGridViewColumn with the specified name from the collection.
Returns: Int32. The index of the given DataGridViewColumn.
Throws:
ArgumentNullException name is null.
Inserts a DataGridViewColumn at the given index in the collection.
Throws:
ArgumentNullException column is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added:Selecting all cells in the control.Clearing the selection.Updating column DisplayIndex property values; or this method is being called from a handler for one of the following DataGridView events:CellEnterCellLeaveCellValidatingCellValidatedRowEnterRowLeaveRowValidatedRowValidating or column already belongs to a DataGridView control; or the column SortMode property value is Automatic and the SelectionMode property value is FullColumnSelect or ColumnHeaderSelect. Use the control System#ComponentModel#ISupportInitialize#BeginInit and System#ComponentModel#ISupportInitialize#EndInit methods to temporarily set conflicting property values; or the column InheritedAutoSizeMode property value is ColumnHeader and the ColumnHeadersVisible property value is false; or column has an InheritedAutoSizeMode property value of Fill and a Frozen property value of true; or column has DisplayIndex and Frozen property values that would display it among a set of adjacent columns with the opposite Frozen property value; or the DataGridView control contains at least one row and column has a CellType property value of null.
Removes the specified DataGridViewColumn from the collection.
Throws:
ArgumentException column is not in the collection.
ArgumentNullException column is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added:Selecting all cells in the control.Clearing the selection.Updating column DisplayIndex property values; or this method is being called from a handler for one of the following DataGridView events:CellEnterCellLeaveCellValidatingCellValidatedRowEnterRowLeaveRowValidatedRowValidating
Removes the DataGridViewColumn with the specified name from the collection.
Throws:
ArgumentException name does not match the name of any column in the collection.
ArgumentNullException name is null.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added:Selecting all cells in the control.Clearing the selection.Updating column DisplayIndex property values; or this method is being called from a handler for one of the following DataGridView events:CellEnterCellLeaveCellValidatingCellValidatedRowEnterRowLeaveRowValidatedRowValidating
Removes the DataGridViewColumn at the given index in the collection.
Throws:
ArgumentOutOfRangeException index is less than zero or greater than the number of columns in the control minus one.
InvalidOperationException The associated DataGridView control is performing one of the following actions that temporarily prevents new columns from being added: - Selecting all cells in the control. - Clearing the selection.Updating column DisplayIndex property values. Or this method is being called from a handler for one of the following DataGridView events: - CellEnter - CellLeave - CellValidating - CellValidated - RowEnter - RowLeave - RowValidated - RowValidating
Moves the specified column to the new newIndex .
This method updates both the column's index in the column collection and the display index without firing the ColumnDisplayIndexChanged event.
CollectionChangeEventHandler Fired when the collection changes.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
column
The DataGridViewColumn to add.
name
The name by which the column will be referred.
name
The name by which the column will be referred.
valueType
The Type of the values in the cells.
name
The name by which the column will be referred.
caption
The text for the column's header.
name
The name by which the column will be referred.
caption
The text for the column's header.
valueType
The Type of the values in the cells.
newColumns
An array of DataGridViewColumn objects to add.
dispose
column
The DataGridViewColumn to look for.
name
The name of the column to look for.
array
The destination DataGridViewColumn array.
index
The index of the destination array at which to start copying.
includeFilter
A combination of the DataGridViewElementStates values for inclusion.
includeFilter
A combination of the DataGridViewElementStates values for inclusion.
column
The DataGridViewColumn to return the index of.
name
The name of the column to find.
index
The zero-based index at which to insert the given column.
column
The DataGridViewColumn to insert.
column
The column to delete.
name
The name of the column to delete.
index
The index of the column to delete.
column
Column to move to the new newIndex .
newIndex
New index and display index of the column .
A combination of the DataGridViewElementStates values for inclusion.
A combination of the DataGridViewElementStates values for exclusion.
A combination of the DataGridViewElementStates values for inclusion.
A combination of the DataGridViewElementStates values for exclusion.
startColumn
The column from which to start searching for the next column.
A combination of the DataGridViewElementStates values for inclusion.
A combination of the DataGridViewElementStates values for exclusion.
startColumn
The column from which to start searching for the previous column.
A combination of the DataGridViewElementStates values for inclusion.
A combination of the DataGridViewElementStates values for exclusion.
dataGrid
The DataGridView that created this collection.
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter
includeFilter
excludeFilter