LogoLogo
HomeNewsSupportVideos
v2.5
v2.5
  • Welcome
  • What's New
  • Releases
  • Concepts
  • Themes
  • Extensions
  • Wisej.Web
    • General
      • Application
        • Application.FormCollection
        • Application.PageCollection
        • HashChangedEventArgs
        • HashChangedEventHandler
        • LicenseErrorEventArgs
        • LicenseErrorEventHandler
        • ResponsiveProfileChangedEventArgs
        • ResponsiveProfileChangedEventHandler
      • Clipboard
      • Component
      • Control
        • Control.ControlCollection
        • ControlEventArgs
        • ControlEventHandler
        • DragEventArgs
        • DragEventHandler
        • HelpEventArgs
        • HelpEventHandler
        • KeyEventArgs
        • KeyEventHandler
        • KeyPressEventArgs
        • KeyPressEventHandler
        • LayoutEventArgs
        • LayoutEventHandler
        • MouseEventArgs
        • MouseEventHandler
        • PaintEventArgs
        • PaintEventHandler
        • PinchEventArgs
        • PinchEventHandler
        • PreviewKeyDownEventArgs
        • PreviewKeyDownEventHandler
        • QueryContinueDragEventArgs
        • QueryContinueDragEventHandler
        • ResponsiveProfileChangedEventArgs
        • ResponsiveProfileChangedEventHandler
        • RotateEventArgs
        • RotateEventHandler
        • SwipeEventArgs
        • SwipeEventHandler
        • TouchEventArgs
        • TouchEventHandler
        • TrackEventArgs
        • TrackEventHandler
        • WidgetEventArgs
        • WidgetEventHandler
      • Cursor
      • Cursors
      • DataObject
      • Padding
      • Screen
    • Buttons
      • Button
        • MenuButtonItemClickedEventArgs
        • MenuButtonItemClickedEventHandler
      • ButtonBase
      • CheckBox
      • RadioButton
      • SplitButton
    • Common Dialogs
      • ColorDialog
      • CommonDialog
      • FileDialog
      • FileDialogLoadPathEventArgs
      • FileDialogLoadPathEventHandler
      • FileDialogRootCollection
      • FileDialogUI
      • FolderBrowserDialog
      • FolderBrowserDialogUI
      • OpenFileDialog
      • SaveFileDialog
    • Containers
      • Accordion
        • AccordionAction
        • AccordionCancelEventArgs
        • AccordionCancelEventHandler
        • AccordionEventArgs
        • AccordionEventHandler
        • AccordionPanel
      • ContainerControl
        • AcceleratorEventArgs
        • AcceleratorEventHandler
      • DataRepeater
        • DataRepeaterAddRemoveItemsCancelEventArgs
        • DataRepeaterAddRemoveItemsCancelEventHandler
        • DataRepeaterAddRemoveItemsEventArgs
        • DataRepeaterAddRemoveItemsEventHandler
        • DataRepeaterDataErrorEventArgs
        • DataRepeaterDataErrorEventHandler
        • DataRepeaterItem
        • DataRepeaterItemCloneEventHandler
        • DataRepeaterItemEventArgs
        • DataRepeaterItemEventHandler
        • DataRepeaterItemValueEventArgs
        • DataRepeaterItemValueEventHandler
        • DataRepeaterLayoutStyles
      • Desktop
        • DesktopTaskBarItem
        • DesktopTaskBarItemClickEventArgs
        • DesktopTaskBarItemClickEventHandler
        • DesktopTaskBarItemCollection
        • DesktopTaskBarItemControl
        • DesktopTaskBarItemDateTime
      • FlexLayoutPanel
        • FlexLayoutStyle
      • FlowLayoutPanel
        • FlowDirection
      • Form
        • CloseReason
        • FormBorderStyle
        • FormClosedEventArgs
        • FormClosedEventHandler
        • FormClosingEventArgs
        • FormClosingEventHandler
        • FormStartPosition
        • FormWindowState
        • MdiClient
        • MdiTabProperties
      • GroupBox
      • Page
      • Panel
      • ScrollableControl
        • ScrollEventArgs
        • ScrollEventHandler
      • SlideBar
      • SplitContainer
        • FixedPanel
        • SplitterCancelEventArgs
        • SplitterCancelEventHandler
        • SplitterEventArgs
        • SplitterEventHandler
        • SplitterPanel
      • StatusBar
        • StatusBarControl
        • StatusBarPanel
        • StatusBarPanelAutoSize
        • StatusBarPanelBorderStyle
        • StatusBarPanelClickEventArgs
        • StatusBarPanelClickEventHandler
      • TabControl
        • TabAlignment
        • TabControlAction
        • TabControlCancelEventArgs
        • TabControlCancelEventHandler
        • TabControlEventArgs
        • TabControlEventHandler
        • TabPage
        • TabSizeMode
      • TableLayoutPanel
        • ColumnStyle
        • RowStyle
        • TableLayoutColumnStyleCollection
        • TableLayoutPanelGrowStyle
        • TableLayoutRowStyleCollection
        • TableLayoutSettings
        • TableLayoutStyle
        • TableLayoutStyleCollection
      • ToolBar
        • ToolBar.ToolBarButtonCollection
        • ToolBarButton
        • ToolBarButtonClickEventArgs
        • ToolBarButtonClickEventHandler
        • ToolBarButtonSizeMode
        • ToolBarButtonStyle
        • ToolBarTextAlign
      • UserControl
      • UserPopup
    • Content
      • AspNetPanel
      • Canvas
      • HtmlPanel
        • HtmlPanelElementClickArgs
        • HtmlPanelElementClickHandler
      • IFramePanel
      • ImageList
        • ImageList.ImageCollection
      • Label
      • Line
      • LinkLabel
        • LinkArea
        • LinkLabelLinkClickedEventArgs
        • LinkLabelLinkClickedEventHandler
      • PdfViewer
      • PictureBox
      • ProgressBar
      • ScrollBar
        • HScrollBar
        • HScrollProperties
        • ScrollEventArgs
        • ScrollEventHandler
        • ScrollProperties
        • VScrollBar
        • VScrollProperties
      • Shape
      • Spacer
      • Upload
        • CaptureMode
        • UploadedEventArgs
        • UploadedEventHandler
        • UploadErrorEventArgs
        • UploadErrorEventHandler
        • UploadErrorType
        • UploadingEventArgs
        • UploadingEventHandler
        • UploadProgressEventArgs
        • UploadProgressEventHandler
      • WebBrowser
        • WebBrowserDocumentCompletedEventArgs
        • WebBrowserDocumentCompletedEventHandler
      • Widget
        • WebRequestEventArgs
        • WebRequestHandler
    • Data Binding
      • Binding
      • BindingCompleteContext
      • BindingCompleteEventArgs
      • BindingCompleteEventHandler
      • BindingCompleteState
      • BindingContext
      • BindingManagerBase
      • BindingManagerDataErrorEventArgs
      • BindingManagerDataErrorEventHandler
      • BindingMemberInfo
      • BindingNavigator
      • BindingsCollection
      • BindingSource
      • ControlBindingsCollection
      • ControlUpdateMode
      • ConvertEventArgs
      • ConvertEventHandler
      • CurrencyManager
      • DataSourceUpdateMode
      • IBindableComponent
      • ICurrencyManagerProvider
      • ItemChangedEventArgs
      • ItemChangedEventHandler
      • ListBindingConverter
      • ListBindingHelper
      • PropertyManager
    • Editors
      • CharacterCasing
      • ComponentTool
      • ComponentToolCollection
      • DateTimePicker
      • DomainUpDown
      • InputType
      • LabelWrapper
      • MaskedTextBox
      • MonthCalendar
        • DateRangeEventArgs
        • DateRangeEventHandler
        • SelectionRange
      • NumericUpDown
      • TagTextBox
        • TagTextBoxEventArgs
        • TagTextBoxEventHandler
        • TagTextBoxMousEventArgs
        • TagTextBoxMousEventHandler
        • TagTextBoxRenderEventArgs
        • TagTextBoxRenderEventHandler
      • TextBox
      • TextBoxBase
      • TextBoxMode
      • TextBoxType
      • TimeUpDown
        • TimeUpDownFormat
      • TrackBar
      • UpDownBase
    • Enumerations
      • AccessibleRole
      • AnchorStyles
      • Appearance
      • AutoComplete
      • AutoCompleteMode
      • AutoScaleMode
      • AutoSizeMode
      • AutoValidate
      • BorderStyle
      • BoundsSpecified
      • CheckState
      • ColorDepth
      • ComboBoxStyle
      • ControlStyles
      • DataFormats
      • DataFormats.Format
      • DateTimePickerFormat
      • Day
      • DialogResult
      • Display
      • DockStyle
      • DragAction
      • DragDropEffects
      • GetChildAtPointSkip
      • HeaderPosition
      • HorizontalAlignment
      • ImageLayout
      • ImagePosition
      • ImeMode
      • Keys
      • LabelPosition
      • LeftRightAlignment
      • LineStyle
      • LinkBehavior
      • MaskFormat
      • MouseButtons
      • ObjectFit
      • Orientation
      • PanelAutoShowMode
      • PictureBoxSizeMode
      • Placement
      • PlacementMode
      • Position
      • RightToLeft
      • ScrollBars
      • ScrollEventType
      • ScrollOrientation
      • SelectionMode
      • Shortcut
      • SizeType
      • SortOrder
      • TabOrderManagerDirection
      • TextDataFormat
      • TextImageRelation
      • TickStyle
      • ValidationConstraints
      • VerticalAlignment
    • Extenders
      • Animation
        • AnimationEventArgs
        • AnimationEventHandler
      • ErrorAnimationType
      • ErrorBlinkStyle
      • ErrorIconAlignment
      • ErrorProvider
      • HelpTip
      • JavaScript
      • Rotation
      • StyleSheet
      • TabOrderManager
      • ToolTip
      • ToolTipIcon
    • Interfaces
      • IButtonControl
      • IContainerControl
      • IDataObject
    • Lists & Grids
      • CheckedListBox
        • ItemCheckEventArgs
        • ItemCheckEventHandler
      • ComboBox
      • DataGridView
        • BaseCollection
        • DataGridView.HitTestInfo
        • DataGridView.HitTestType
        • DataGridViewAutoSizeColumnMode
        • DataGridViewAutoSizeColumnsMode
        • DataGridViewAutoSizeRowMode
        • DataGridViewAutoSizeRowsMode
        • DataGridViewBand
        • DataGridViewBindingCompleteEventArgs
        • DataGridViewBindingCompleteEventHandler
        • DataGridViewButtonCell
        • DataGridViewButtonColumn
        • DataGridViewCell
        • DataGridViewCellBorderStyle
        • DataGridViewCellCancelEventArgs
        • DataGridViewCellCancelEventHandler
        • DataGridViewCellCollection
        • DataGridViewCellContextMenuNeededEventArgs
        • DataGridViewCellContextMenuNeededEventHandler
        • DataGridViewCellErrorTextNeededEventArgs
        • DataGridViewCellErrorTextNeededEventHandler
        • DataGridViewCellEventArgs
        • DataGridViewCellEventHandler
        • DataGridViewCellFormattingEventArgs
        • DataGridViewCellFormattingEventHandler
        • DataGridViewCellMouseEventArgs
        • DataGridViewCellMouseEventHandler
        • DataGridViewCellPaintEventArgs
        • DataGridViewCellPaintEventHandler
        • DataGridViewCellParsingEventArgs
        • DataGridViewCellParsingEventHandler
        • DataGridViewCellStateChangedEventArgs
        • DataGridViewCellStateChangedEventHandler
        • DataGridViewCellStyle
        • DataGridViewCellStyleContentChangedEventArgs
        • DataGridViewCellStyleContentChangedEventHandler
        • DataGridViewCellStyleScopes
        • DataGridViewCellToolTipTextNeededEventArgs
        • DataGridViewCellToolTipTextNeededEventHandler
        • DataGridViewCellValidatingEventArgs
        • DataGridViewCellValidatingEventHandler
        • DataGridViewCellValueEventArgs
        • DataGridViewCellValueEventHandler
        • DataGridViewCheckBoxCell
        • DataGridViewCheckBoxColumn
        • DataGridViewChildRowCollection
        • DataGridViewClipboardCopyMode
        • DataGridViewCollectionChangeEventArgs
        • DataGridViewColumn
        • DataGridViewColumnCollection
        • DataGridViewColumnEventArgs
        • DataGridViewColumnEventHandler
        • DataGridViewColumnHeaderCell
        • DataGridViewColumnHeadersHeightSizeMode
        • DataGridViewColumnSortMode
        • DataGridViewColumnsSortMode
        • DataGridViewColumnStateChangedEventArgs
        • DataGridViewColumnStateChangedEventHandler
        • DataGridViewComboBoxCell
        • DataGridViewComboBoxColumn
        • DataGridViewComboBoxEditingControl
        • DataGridViewContentAlignment
        • DataGridViewDataErrorEventArgs
        • DataGridViewDataErrorEventHandler
        • DataGridViewDataReadEventHandler
        • DataGridViewDataUpdatedEventArgs
        • DataGridViewDataUpdatedEventHandler
        • DataGridViewDateTimePickerCell
        • DataGridViewDateTimePickerColumn
        • DataGridViewDateTimePickerEditingControl
        • DataGridViewEditingControlShowingEventArgs
        • DataGridViewEditingControlShowingEventHandler
        • DataGridViewEditMode
        • DataGridViewElement
        • DataGridViewElementStates
        • DataGridViewHeaderCell
        • DataGridViewImageCell
        • DataGridViewImageCellLayout
        • DataGridViewImageColumn
        • DataGridViewLinkCell
        • DataGridViewLinkColumn
        • DataGridViewMaskedTextBoxCell
        • DataGridViewMaskedTextBoxColumn
        • DataGridViewMaskedTextBoxEditingControl
        • DataGridViewNumericUpDownCell
        • DataGridViewNumericUpDownColumn
        • DataGridViewNumericUpDownEditingControl
        • DataGridViewRow
        • DataGridViewRowCancelEventArgs
        • DataGridViewRowCancelEventHandler
        • DataGridViewRowCollection
        • DataGridViewRowErrorTextNeededEventArgs
        • DataGridViewRowErrorTextNeededEventHandler
        • DataGridViewRowEventArgs
        • DataGridViewRowEventHandler
        • DataGridViewRowHeaderCell
        • DataGridViewRowHeadersWidthSizeMode
        • DataGridViewRowHeightInfoNeededEventArgs
        • DataGridViewRowHeightInfoNeededEventHandler
        • DataGridViewRowsAddedEventArgs
        • DataGridViewRowsAddedEventHandler
        • DataGridViewRowsRemovedEventArgs
        • DataGridViewRowsRemovedEventHandler
        • DataGridViewRowStateChangedEventArgs
        • DataGridViewRowStateChangedEventHandler
        • DataGridViewSelectedCellCollection
        • DataGridViewSelectedColumnCollection
        • DataGridViewSelectedRowCollection
        • DataGridViewSelectionMode
        • DataGridViewSortCompareEventArgs
        • DataGridViewSortCompareEventHandler
        • DataGridViewSortSelectionMode
        • DataGridViewTextBoxCell
        • DataGridViewTextBoxColumn
        • DataGridViewTextBoxEditingControl
        • DataGridViewToolClickEventHandler
        • DataGridViewTriState
        • IDataGridViewEditingControl
        • InputType
        • ScrollEventArgs
        • ScrollEventHandler
        • TextBoxMode
        • TextBoxType
      • ListBox
      • ListControl
        • ListControlConvertEventArgs
        • ListControlConvertEventHandler
      • ListView
        • CacheVirtualItemsEventArgs
        • CacheVirtualItemsEventHandler
        • ColumnClickEventArgs
        • ColumnClickEventHandler
        • ColumnHeader
        • ColumnHeaderAutoResizeStyle
        • ColumnHeaderStyle
        • ColumnReorderedEventArgs
        • ColumnReorderedEventHandler
        • ColumnWidthChangedEventArgs
        • ColumnWidthChangedEventHandler
        • GridLineStyle
        • ImageColumnHeader
        • ItemCheckedEventArgs
        • ItemCheckedEventHandler
        • ItemClickEventArgs
        • ItemClickEventHandler
        • ItemMouseHoverEventArgs
        • ItemMouseHoverEventHandler
        • ItemSelectionChangedEventArgs
        • ItemSelectionChangedEventHandler
        • LabelEditEventArgs
        • LabelEditEventHandler
        • ListView.CheckedIndexCollection
        • ListView.CheckedListViewItemCollection
        • ListView.ColumnHeaderCollection
        • ListView.ListViewItemCollection
        • ListView.SelectedIndexCollection
        • ListView.SelectedListViewItemCollection
        • ListViewBindingCompleteEventArgs
        • ListViewBindingCompleteEventEventHandler
        • ListViewDataUpdatedEventArgs
        • ListViewDataUpdatedEventHandler
        • ListViewItem
        • ListViewItem.ListViewSubItem
        • ListViewItem.ListViewSubItemCollection
        • ListViewItemDragEventArgs
        • ListViewItemDragEventHandler
        • ListViewItemStates
        • ListViewVirtualItemsSelectionRangeChangedEventArgs
        • ListViewVirtualItemsSelectionRangeChangedEventHandler
        • RetrieveVirtualItemEventArgs
        • RetrieveVirtualItemEventHandler
        • SearchForVirtualItemEventArgs
        • SearchForVirtualItemEventHandler
        • View
      • ListViewComboBox
      • PropertyGrid
        • GridItem
        • GridItemCollection
        • GridItemType
        • PropertySort
        • PropertyValueChangedEventArgs
        • PropertyValueChangedEventHandler
        • PropertyValueDataErrorEventArgs
        • PropertyValueDataErrorEventHandler
        • PropertyValueFormattingEventArgs
        • PropertyValueFormattingEventHandler
        • SelectedGridItemBeginEditEventArgs
        • SelectedGridItemBeginEditEventHandler
        • SelectedGridItemChangedEventArgs
        • SelectedGridItemChangedEventHandler
        • SelectedGridItemEndEditEventArgs
        • SelectedGridItemEndEditEventHandler
      • TreeView
        • ItemDragEventArgs
        • ItemDragEventHandler
        • NodeLabelEditEventArgs
        • NodeLabelEditEventHandler
        • TreeNode
        • TreeNodeCollection
        • TreeNodeMouseClickEventArgs
        • TreeNodeMouseClickEventHandler
        • TreeNodeMouseHoverEventArgs
        • TreeNodeMouseHoverEventHandler
        • TreeViewAction
        • TreeViewCancelEventArgs
        • TreeViewCancelEventHandler
        • TreeViewEventArgs
        • TreeViewEventHandler
        • TreeViewNodeDragEventArgs
        • TreeViewNodeDragEventHandler
      • TreeViewComboBox
      • UserComboBox
    • Media
      • Audio
      • FlashPlayer
      • Media
      • Video
    • Menus
      • CheckedMenuItem
      • ContextMenu
      • LinkMenuItem
      • MainMenu
      • Menu
      • Menu.MenuItemCollection
      • MenuBar
      • MenuItem
      • MenuItemEventArgs
      • MenuItemEventHandler
      • MenuItemSizeMode
      • MenuMerge
    • Notifications
      • AlertBox
        • MessageBoxIcon
      • MessageBox
        • MessageBoxButtons
        • MessageBoxDefaultButton
        • MessageBoxIcon
      • Toast
    • Other Components
      • Timer
  • Wisej.Base
    • General
      • Component
      • Cookie
      • CookieCollection
      • PostbackPropertyAttribute
      • TextUtils
    • Responsive
      • ResponsiveProfile
      • ResponsiveProfileCollection
      • ResponsivePropertyAttribute
  • Wisej.Core
    • General
      • BrowserStorage
      • ClientBrowser
      • ClientProfile
      • ClientTheme
      • CookieStorage
      • FileSystemProvider
      • HealthCheck
      • IEventFilter
      • IFileSystemProvider
      • LocalStorage
      • MimeTypes
      • SessionStorage
      • SynchronizedLinkedList<T>
      • SynchronizedList<T>
      • WebMethodAttribute
      • WisejEventArgs
        • WisejEventArgs.KeyboardInfo
        • WisejEventArgs.PointerInfo
      • WisejResourcesAttribute
      • WisejSerializer
      • WisejSerializerOptions
    • Interfaces
      • IWisejComponent
      • IWisejControl
      • IWisejDataStore
      • IWisejEditorService
      • IWisejExtenderProvider
      • IWisejHandler
      • IWisejSerializable
      • IWisejWindow
  • Wisej.Web.VisualBasic
    • Extensions
      • Interaction
      • MsgBoxResult
      • MsgBoxStyle
  • System
    • Extensions
      • DateTimeExtensions
      • FontExtensions
      • JSON
      • StringExtensions
Powered by GitBook
On this page
  • Constructors
  • DataGridViewColumnCollection(dataGrid)
  • Properties
  • Item(index)
  • Item(name)
  • Methods
  • Add(column)
  • Add(name)
  • Add(name, valueType)
  • Add(name, caption)
  • Add(name, caption, valueType)
  • AddRange(newColumns)
  • Clear()
  • Clear(dispose)
  • Contains(column)
  • Contains(name)
  • CopyTo(array, index)
  • GetColumnCount(includeFilter)
  • GetColumnsWidth(includeFilter)
  • GetFirstColumn(includeFilter, excludeFilter)
  • GetLastColumn(includeFilter, excludeFilter)
  • GetNextColumn(startColumn, includeFilter, excludeFilter)
  • GetPreviousColumn(startColumn, includeFilter, excludeFilter)
  • IndexOf(column)
  • IndexOf(name)
  • Insert(index, column)
  • Remove(column)
  • Remove(name)
  • RemoveAt(index)
  • SetColumnIndex(column, newIndex)
  • Events
  • CollectionChanged

Was this helpful?

Export as PDF
  1. Wisej.Web
  2. Lists & Grids
  3. DataGridView

DataGridViewColumnCollection

Wisej.Web.DataGridViewColumnCollection

Last updated 2 years ago

Was this helpful?

Namespace: Wisej.Web

Assembly: Wisej.Framework (2.5.0.0)

  • BaseCollection

    • DataGridViewColumnCollection

Represents a collection of DataGridViewColumn objects in a DataGridView control.

public class DataGridViewColumnCollection : BaseCollection, IList, IList<DataGridViewColumn>, ICollection<DataGridViewColumn>, IEnumerable<DataGridViewColumn>
Public Class DataGridViewColumnCollection
    Inherits BaseCollection
    Implements IList, IList(Of DataGridViewColumn), ICollection(Of DataGridViewColumn), IEnumerable(Of DataGridViewColumn)

Constructors

DataGridViewColumnCollection(dataGrid)

Initializes a new instance of the DataGridViewColumnCollection class for the given DataGridView.

Name
Type
Description

dataGrid

Properties

Item(index)

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.

Methods

Adds the given DataGridViewColumn to the collection.

Parameter
Type
Description

column

Returns: Int32. The index of the column.

Throws:

  • ArgumentNullException column is null.

Adds a DataGridViewTextBoxColumn with the given column name to the collection.

Parameter
Type
Description

name

The name by which the column will be referred.

Returns: Int32. The index of the column.

Throws:

Adds a DataGridViewTextBoxColumn with the given column name and call value type to the collection.

Parameter
Type
Description

name

The name by which the column will be referred.

valueType

Returns: Int32. The index of the column.

Throws:

Adds a DataGridViewTextBoxColumn with the given column name and column header text to the collection.

Parameter
Type
Description

name

The name by which the column will be referred.

caption

The text for the column's header.

Returns: Int32. The index of the column.

Throws:

Adds a DataGridViewTextBoxColumn with the given column name, column header text, and cell value type to the collection.

Parameter
Type
Description

name

The name by which the column will be referred.

caption

The text for the column's header.

valueType

Returns: Int32. The index of the column.

Throws:

Adds a range of columns to the collection.

Parameter
Type
Description

newColumns

Throws:

  • ArgumentNullException newColumns is null.

Clears the collection.

Throws:

Clears the collection and disposes the columns.

Parameter
Type
Description

dispose

Determines whether the collection contains the given DataGridViewColumn.

Parameter
Type
Description

column

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

Determines whether the collection contains the given DataGridViewColumn.

Parameter
Type
Description

name

The name of the column to look for.

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

Copies the items from the collection to the given array.

Parameter
Type
Description

array

index

The index of the destination array at which to start copying.

Returns the number of columns that match the includeFilter .

Parameter
Type
Description

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 .

Parameter
Type
Description

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 .

Parameter
Type
Description

includeFilter

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 .

Parameter
Type
Description

includeFilter

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 .

Parameter
Type
Description

startColumn

The column from which to start searching for the next column.

includeFilter

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 .

Parameter
Type
Description

startColumn

The column from which to start searching for the previous column.

includeFilter

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.

Parameter
Type
Description

column

Returns: Int32. The index of the given DataGridViewColumn.

Returns the index of the DataGridViewColumn with the specified name from the collection.

Parameter
Type
Description

name

The name of the column to find.

Returns: Int32. The index of the given DataGridViewColumn.

Throws:

  • ArgumentNullException name is null.

Inserts a DataGridViewColumn at the given index in the collection.

Parameter
Type
Description

index

The zero-based index at which to insert the given column.

column

Throws:

  • ArgumentNullException column is null.

Removes the specified DataGridViewColumn from the collection.

Parameter
Type
Description

column

The column to delete.

Throws:

  • ArgumentException column is not in the collection.

  • ArgumentNullException column is null.

Removes the DataGridViewColumn with the specified name from the collection.

Parameter
Type
Description

name

The name of the column to delete.

Throws:

  • ArgumentException name does not match the name of any column in the collection.

  • ArgumentNullException name is null.

Removes the DataGridViewColumn at the given index in the collection.

Parameter
Type
Description

index

The index of the column to delete.

Throws:

  • ArgumentOutOfRangeException index is less than zero or greater than the number of columns in the control minus one.

Moves the specified column to the new newIndex .

Parameter
Type
Description

column

Column to move to the new newIndex .

newIndex

New index and display index of the column .

Events

CollectionChangeEventHandler Fired when the collection changes.

The that created this collection.

Item(name)

Add(column)

The to add.

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Add(name)

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Add(name, valueType)

The of the values in the cells.

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Add(name, caption)

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Add(name, caption, valueType)

The of the values in the cells.

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

AddRange(newColumns)

An array of objects to add.

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Clear()

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

Clear(dispose)

Contains(column)

The to look for.

Contains(name)

CopyTo(array, index)

The destination array.

GetColumnCount(includeFilter)

A combination of the values for inclusion.

GetColumnsWidth(includeFilter)

A combination of the values for inclusion.

GetFirstColumn(includeFilter, excludeFilter)

A combination of the values for inclusion.

A combination of the values for exclusion.

GetLastColumn(includeFilter, excludeFilter)

A combination of the values for inclusion.

A combination of the values for exclusion.

GetNextColumn(startColumn, includeFilter, excludeFilter)

A combination of the values for inclusion.

A combination of the values for exclusion.

GetPreviousColumn(startColumn, includeFilter, excludeFilter)

A combination of the values for inclusion.

A combination of the values for exclusion.

IndexOf(column)

The to return the index of.

IndexOf(name)

Insert(index, column)

The to insert.

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 property values; or this method is being called from a handler for one of the following DataGridView events: or column already belongs to a DataGridView control; or the column property value is and the property value is or . Use the control and methods to temporarily set conflicting property values; or the column property value is and the property value is false; or column has an property value of and a property value of true; or column has and property values that would display it among a set of adjacent columns with the opposite property value; or the DataGridView control contains at least one row and column has a property value of null.

Remove(column)

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 property values; or this method is being called from a handler for one of the following DataGridView events:

Remove(name)

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 property values; or this method is being called from a handler for one of the following DataGridView events:

RemoveAt(index)

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 property values. Or this method is being called from a handler for one of the following DataGridView events: - - - - - - - -

SetColumnIndex(column, newIndex)

This method updates both the column's index in the column collection and the display index without firing the event.

CollectionChanged

DataGridView
DataGridView
DataGridViewColumn
DataGridViewColumn
String
String
Type
Type
String
String
String
String
Type
Type
DataGridViewColumn[]
DataGridViewColumn
Boolean
DataGridViewColumn
DataGridViewColumn
String
DataGridViewColumn[]
DataGridViewColumn
Int32
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewColumn
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewColumn
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewElementStates
DataGridViewColumn
DataGridViewColumn
String
Int32
DataGridViewColumn
DataGridViewColumn
DataGridViewColumn
String
Int32
DataGridViewColumn
Int32
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
DisplayIndex
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
ColumnDisplayIndexChanged
DisplayIndex
SortMode
InheritedAutoSizeMode
InheritedAutoSizeMode
Frozen
DisplayIndex
Frozen
Frozen
CellType
FullColumnSelect
ColumnHeaderSelect
CellEnter
CellLeave
CellValidating
CellValidated
RowEnter
RowLeave
RowValidated
RowValidating
SelectionMode
System#ComponentModel#ISupportInitialize#BeginInit
System#ComponentModel#ISupportInitialize#EndInit
ColumnHeadersVisible
Automatic
ColumnHeader
Fill