DataGridViewColumnCollection::RemoveAt Method (Int32)
.NET Framework (current version)
Removes the column at the given index in the collection.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- index
-
Type:
System::Int32
The index of the column to delete.
| Exception | Condition |
|---|---|
| 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:
-or- This method is being called from a handler for one of the following DataGridView events: |
To remove a column that is automatically generated when binding to a data source, call this method in a DataGridView::DataBindingComplete event handler.
.NET Framework
Available since 2.0
Available since 2.0
Show: