Skip to main content
Version: 4.1

DataGridView

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a data grid control.

public class DataGridView : Control, ISupportInitialize, IWisejDataStore, IWisejHandler, IReadOnly

Constructors

Instance member DataGridView()

Initializes a new instance of the DataGridView class.

Instance member DataGridView(dataSource, onCellClick)

Initializes a new instance of the DataGridView class with a specified data source and an event handler for the CellClick event.

NameTypeDescription
dataSourceObjectThe data source to be displayed in the DataGridView.
onCellClickAction<Object, DataGridViewCellEventArgs>An Action delegate to handle the CellClick event. Can be null.

Instance member DataGridView(location, size)

Initializes a new instance of the DataGridView class with a specified location and size.

NameTypeDescription
locationPointThe location of the DataGridView on its parent control.
sizeSizeThe size of the DataGridView.

Properties

Instance member AllowSortingDataSource

Boolean: Returns or sets whether the DataGridView can automatically sort rows in the DataSource when the data is in an IList object. (Default: True)

When the DataGridView is data-bound, sorting is delegated to the DataSource when it supports sorting (see SupportsSorting). Otherwise, if the data is in an IList object and AllowSortingDataSource is true, Wisej swaps the rows in the data source.

This behavior is different than WinForms, where sorting of the data source is always delegated to the data source and is otherwise ignored. Setting AllowSortingDataSource to false reverts to the same behavior as in WinForms.

Instance member AllowUserToAddRows

Boolean: Returns or sets whether the user can add new rows. (Default: False)

Instance member AllowUserToDeleteRows

Boolean: Returns or sets whether the user is allowed to delete rows from the DataGridView. (Default: False)

Instance member AllowUserToOrderColumns

Boolean: Returns or sets whether manual column repositioning is enabled. (Default: False)

Instance member AllowUserToResizeColumns

Boolean: Returns or sets whether users can resize columns. (Default: True)

Instance member AllowUserToResizeRows

Boolean: Returns or sets whether users can resize rows. (Default: True)

Instance member AutoGenerateColumns

Boolean: Returns or sets whether columns are created automatically when the DataSource or DataMember properties are set. (Default: True)

You can change the default value across the application using the AutoGenerateColumnsDefault property or related AppContext switch.

Static member AutoGenerateColumnsDefault

Boolean: Default value for the AutoGenerateColumns property. Since 3.5.6 (Default: True)

The default is true. You can set the value by code or using AppContext switches: AppContext.SetSwitch("DataGridViewAutoGenerateColumns", false);

Instance member AutoSelectFirstRow

Boolean: Returns or sets whether the first row or cell, depending on SelectionMode, is automatically selected when the grid is populated. Since 3.5.6 (Default: True)

You can change the default value across the application using the AutoSelectFirstRowDefault property or related AppContext switch.

Static member AutoSelectFirstRowDefault

Boolean: Default value for the AutoSelectFirstRow property. Since 3.5.6 (Default: True)

The default is true. You can set the value by code or using AppContext switches: AppContext.SetSwitch("DataGridViewAutoSelectFirstRow", false);

Instance member AutoSize

Boolean: Returns or sets a value that indicates whether the control resizes based on its contents. (Default: False)

Instance member AutoSizeColumnsMode

DataGridViewAutoSizeColumnsMode: Returns or sets a value indicating how column widths are determined. (Default: None)

Instance member AutoSizeRowsMode

DataGridViewAutoSizeRowsMode: Returns or sets a value indicating how row heights are determined. (Default: None)

Throws:

Instance member BlockSize

Int32: Number of rows stored in a cache block. Determines the number of rows requested by the client when scrolling the grid.

It's better not to touch this value unless you know what you are doing.

Instance member BorderStyle

BorderStyle: Returns or sets the border style for the DataGridView. (Default: Solid)

Instance member CellBorderStyle

DataGridViewCellBorderStyle: Returns or sets the cell border style for the DataGridView control. (Default: Both)

Instance member ClientArea

Rectangle: Returns the client rectangle excluding the non-client caption and borders dimensions.

Instance member ClipboardCopyMode

DataGridViewClipboardCopyMode: Returns or sets a value that indicates whether users can copy cell text values to the Clipboard and whether row and column header text is included. (Default: EnableWithAutoHeaderText)

Instance member ColumnCount

Int32: Returns or sets the number of columns displayed in the DataGridView. (Default: 0)

Throws:

Instance member ColumnHeadersBorderStyle

DataGridViewCellBorderStyle: Returns or sets the border style for the column headers in the DataGridView control. (Default: Both)

Instance member ColumnHeadersDefaultCellStyle

DataGridViewCellStyle: Returns or sets the default column header style.

Instance member ColumnHeadersHeight

Int32: Returns or sets the height, in pixels, of the column headers row.

Throws:

  • ArgumentOutOfRangeException The specified value when setting this property is less than the minimum height of 4 pixels or is greater than the maximum height of 32768 pixels.

Instance member ColumnHeadersHeightSizeMode

DataGridViewColumnHeadersHeightSizeMode: Returns or sets whether the height of the column headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the headers. Since 3.0.13 (Default: DisableResizing)

Instance member ColumnHeadersVisible

Boolean: Returns or sets whether the column header row is displayed. (Default: True)

Throws:

Instance member Columns

DataGridViewColumnCollection: Returns a collection that contains all the columns in the control.

Instance member CurrentCell

DataGridViewCell: Returns or sets the currently active cell.

Throws:

  • InvalidOperationException The value of this property cannot be set because changes to the current cell cannot be committed or canceled. Or the specified cell when setting this property is in a hidden row or column. Re-entrant calling is only allowed when the DataGridView is bound to a DataSource. Re-entrant calling results from a change to the underlying data.
  • ArgumentException The specified cell when setting this property is not in the DataGridView.

Instance member CurrentCellAddress

Point: Returns the row and column indexes of the currently active cell.

Instance member CurrentRow

DataGridViewRow: Returns the row containing the current cell.

Instance member DataMember

String: Returns or sets the name of the list or table in the data source for which the DataGridView is displaying data. (Default: "")

Throws:

Instance member DataSource

Object: Returns or sets the data source that the DataGridView is displaying data for. (Default: null)

Throws:

Instance member DefaultCellStyle

DataGridViewCellStyle: Returns or sets the default cell style to be applied to the cells in the DataGridView if no other cell style properties are set.

Instance member DefaultRowHeight

Int32: Returns or sets the default row height.

Instance member DefaultSortMode

DataGridViewColumnsSortMode: Returns or sets the default SortMode for all columns when the property SortMode is set to NotSet (default). (Default: Automatic)

Instance member EditingControl

Control: Returns the control hosted by the current cell, if a cell with an editing control is in edit mode.

Instance member EditMode

DataGridViewEditMode: Returns or sets a value indicating how to begin editing a cell. (Default: EditOnKeystrokeOrF2)

Throws:

  • Exception The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the DataError event or the handler has set the ThrowException property to true. The exception object can typically be cast to type FormatException.

Instance member FirstDisplayedCell

DataGridViewCell: Returns the first scrollable cell currently displayed in the DataGridView in the upper left corner after the frozen rows and columns.

Please note that is there are frozen rows or columns, the first displayed cell is not necessarily the cell in the upper left corner of the grid. It is the first scrollable cell displayed after the frozen rows and columns. The first displayed cell within the frozen area it's simply the first visible frozen column and first visible frozen row since they are always displayed and don't scroll.

Instance member FirstDisplayedColumnIndex

Int32: Returns or sets the index of the column that is the first non-frozen column displayed on the DataGridView.

Please note that if there are frozen columns, the first displayed column is not the first column in the grid but the first displayed column visible after the frozen columns. Since frozen columns are always displayed and don't scroll, the first displayed column within the frozen area is simply the first visible frozen column. Throws:

  • ArgumentOutOfRangeException The specified value when setting this property is less than 0 or greater than the number of columns in the control minus 1.
  • InvalidOperationException The specified value when setting this property indicates a column with a Visible property value of false. Or the specified value when setting this property indicates a column with a Frozen property value of true.

Instance member FirstDisplayedRowIndex

Int32: Returns the index of the row that is the first row displayed on the DataGridView below the frozen rows.

Please note that if there are frozen rows, the first displayed row is not the first row in the grid but the first row visible after the frozen rows. Since frozen rows are always displayed and don't scroll, the first displayed row within the frozen area is simply the first visible frozen row.

Instance member HorizontalScrollingOffset

Int32: Returns the number of pixels by which the control is scrolled horizontally.

Instance member HScroll

Boolean: Returns whether the horizontal scroll bar is visible.

Instance member Indent

Int32: Returns or sets the distance in pixels to indent each child row node level. (Default: -1)

Throws:

Instance member IsCurrentCellDirty

Boolean: Returns a value indicating whether the current cell has uncommitted changes.

Instance member IsCurrentCellInEditMode

Boolean: Returns a value indicating whether the currently active cell is being edited.

Instance member IsCurrentRowDirty

Boolean: Returns a value indicating whether the current row has uncommitted changes.

Instance member Item(columnIndex, rowIndex)

DataGridViewCell: Returns or set the cell located in the specified column and at the specified row.

Throws:

  • ArgumentOutOfRangeException columnIndex is less than 0 or greater than the number of columns in the control minus 1; or rowIndex is less than 0 or greater than the number of rows in the control minus 1.

Instance member Item(columnName, rowIndex)

DataGridViewCell: Returns or set the cell located in the specified column and at the specified row.

Instance member Item(column, rowIndex)

DataGridViewCell: Returns or set the cell located in the specified column and at the specified row.

Instance member Item(cellAddress)

DataGridViewCell: Returns or set the cell located in the specified location.

Instance member KeepSameRowHeight

Boolean: Returns or sets whether the rows are always of the same height. (Default: False)

Instance member LiveResize

Boolean: Returns or sets whether the column and row resizing should be live: updated as the user resizes the row or the column. (Default: False)

Instance member MaxCachedBlocks

Int32: Maximum number of blocks kept in the client cache.

It's better not to touch this value unless you know what you are doing.

Instance member MultiSelect

Boolean: Returns or sets whether the user is allowed to select more than one cell, row, or column of the DataGridView at a time. (Default: True)

Instance member NewRowIndex

Int32: Returns the index of the row for new records.

Instance member NoDataMessage

String: Returns or sets an HTML string that is displayed when the DataGridView doesn't contain any row. (Default: "")

Instance member ReadOnly

Boolean: Returns or sets whether the user can edit the cells of the DataGridView control. (Default: False)

Throws:

  • InvalidOperationException The specified value when setting this property is true, the current cell is in edit mode, and the current cell contains changes that cannot be committed.
  • Exception The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the DataError event or the handler has set the ThrowException property to true. The exception object can typically be cast to type FormatException.

Instance member RightClickSelection

Boolean: Returns or sets whether the row under the pointer gets selected on a right click. (Default: False)

When the right click lands outside of a selected area the selection is not changed regardless of the value of RightClickSelection.

Instance member RowCount

Int32: Returns or sets the number of rows displayed in the DataGridView. (Default: 0)

Throws:

Instance member RowHeaderColumn

DataGridViewColumn: Returns the DataGridViewColumn for the row headers.

Use this DataGridViewColumn to set the style and other properties for all the row headers.

Instance member RowHeadersDefaultCellStyle

DataGridViewCellStyle: Returns or sets the default style applied to the row header cells.

Instance member RowHeadersMaximumWidth

Int32: Returns or sets the minimum width, in pixels, of the column that contains the row headers.

Throws:

  • ArgumentOutOfRangeException The value is less than the minimum width of 2 pixels or is greater than the maximum width of 32000 pixels.

Instance member RowHeadersMinimumWidth

Int32: Returns or sets the minimum width, in pixels, of the column that contains the row headers.

Throws:

  • ArgumentOutOfRangeException The value is less than the minimum width of 2 pixels or is greater than the maximum width of 2000 pixels.

Instance member RowHeadersVisible

Boolean: Returns or sets whether the column that contains row headers is displayed. (Default: True)

Instance member RowHeadersWidth

Int32: Returns or sets the width, in pixels, of the column that contains the row headers.

Throws:

  • ArgumentOutOfRangeException The value is less than the minimum width of 2 pixels or is greater than the maximum width of 2000 pixels.

Instance member RowHeadersWidthSizeMode

DataGridViewRowHeadersWidthSizeMode: Returns or sets whether the width of the row headers is adjustable and whether it can be adjusted by the user or is automatically adjusted to fit the contents of the headers. (Default: EnableResizing)

Instance member Rows

DataGridViewRowCollection: Returns a collection that contains all the rows in the DataGridView control.

Instance member RowTemplate

DataGridViewRow: Returns or sets the row that represents the template for all the rows in the control.

Throws:

Instance member ScrollBars

ScrollBars: Returns or sets the type of scroll bars to display for the DataGridView control. (Default: Both)

Instance member SelectedCells

DataGridViewSelectedCellCollection: Returns the collection of selected cells.

Instance member SelectedColumns

DataGridViewSelectedColumnCollection: Returns the collection of selected columns.

Instance member SelectedRows

DataGridViewSelectedRowCollection: Returns the collection of selected rows.

Instance member SelectionDelay

Int32: Milliseconds to wait before sending selection events to the server. (Default: 150)

Use this property to avoid flooding the server with selection change events when users quickly select rows in a data-bound DataGridView that triggers other data-bounds controls to get updated. Throws:

Instance member SelectionMode

DataGridViewSelectionMode: Returns or sets a value indicating how the cells of the DataGridView can be selected. (Default: FullRowSelect)

Instance member ShowCellErrors

Boolean: Returns or sets whether cells will display an error glyphs for each cell that contains a data entry error. (Default: True)

Instance member ShowCellToolTips

Boolean: Returns or sets whether or not ToolTips will show when the mouse pointer pauses on a cell. (Default: True)

Instance member ShowColumnVisibilityMenu

Boolean: Returns or sets whether the column visibility menu button is visible. (Default: True)

Instance member ShowFocusCell

Boolean: Returns or sets a value indicating whether the DataGridView widget highlights the currently focused cell. (Default: True)

Instance member ShowRowErrors

Boolean: Returns or sets whether row headers will display an error glyphs for each row that contains a data entry error. (Default: True)

Instance member SortedColumn

DataGridViewColumn: Returns the column by which the DataGridView contents are currently sorted.

Instance member SortFrozenRows

Boolean: Returns or sets whether frozen rows should be sorted when sorting a column. (Default: True)

Instance member SortOrder

SortOrder: Returns a value indicating whether the items in the DataGridView control are sorted in ascending or descending order, or are not sorted.

Instance member SortSelectionMode

DataGridViewSortSelectionMode: Returns or sets a value indicating how the DataGridView updates the selection of rows and cells when it's sorted. (Default: UpdatePosition)

The selection is always cleared when sorting a data-bound DataGridView or when the grid contains hierarchical rows.

Instance member StandardReturn

Boolean: Returns or sets whether the RETURN (Enter) key moves the focus to the cell below the current cell, rather than entering edit mode. (Default: False)

WinForms standard behavior corresponds to StandardReturn set to true.

Instance member StandardTab

Boolean: Returns or sets whether the TAB key moves the focus to the next control in the tab order rather than moving focus to the next cell. (Default: False)

Instance member Tools

ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this control.

Instance member ToolsPosition

Position: Returns or sets the position of the ComponentTool items associated with this control. (Default: Top)

Instance member TopLeftHeaderCell

DataGridViewColumnHeaderCell: Returns or sets the header cell located in the upper left corner of the DataGridView control.

Instance member TreeColumn

DataGridViewColumn: Returns or sets the column that displays the node open/close tree icons.

By default the DataGridView shows the open/close tree icons on the first visible and non-frozen column.

Instance member VirtualMode

Boolean: Returns or sets whether you have provided your own data-management operations for the DataGridView control. (Default: False)

Instance member VisibleRowCount

Int32: Returns the total number of visible rows currently displayed.

Don't confuse this property with the total number of rows that are not hidden. This is the number of rows that are actually visible in the DataGridView's viewport. To get the total number of rows that are not hidden, use the VisibleCount property of the Rows collection.

Instance member VScroll

Boolean: Returns whether the vertical scroll bar is visible.

Methods

Instance member AddSummaryRows(summaryType, groupCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in column groupCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
groupColStringName of the column that determines the group break values.
summaryColStringname of the column to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, summaryPosition, groupCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in column groupCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
summaryPositionSummaryRowPositionIndicates the position of the DataGridViewSummaryRow.
groupColStringName of the column that determines the group break values.
summaryColStringName of the column to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, groupFromCol, groupToCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in the columns from groupFromCol to groupToCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
groupFromColStringName of the first column that determines the group break values.
groupToColStringName of the last column that determines the group break values.
summaryColStringName of the column to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, summaryPosition, groupFromCol, groupToCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in the columns from groupFromCol to groupToCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
summaryPositionSummaryRowPositionIndicates the position of the DataGridViewSummaryRow.
groupFromColStringName of the first column that determines the group break values.
groupToColStringName of the last column that determines the group break values.
summaryColStringName of the column to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, groupCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in columns groupCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
groupColDataGridViewColumnColumn that determines the group break values.
summaryColDataGridViewColumnColumn to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, summaryPosition, groupCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in columns groupCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
summaryPositionSummaryRowPositionIndicates the position of the DataGridViewSummaryRow.
groupColDataGridViewColumnColumn that determines the group break values.
summaryColDataGridViewColumnColumn to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, groupFromCol, groupToCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in the columns from groupFromCol to groupToCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
groupFromColDataGridViewColumnFirst column that determines the group break values.
groupToColDataGridViewColumnLast column that determines the group break values.
summaryColDataGridViewColumnColumn to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member AddSummaryRows(summaryType, summaryPosition, groupFromCol, groupToCol, summaryCol, style, customSummary)

Creates or updates a DataGridViewSummaryRow for each group limited by the values in the columns from groupFromCol to groupToCol .

ParameterTypeDescription
summaryTypeSummaryTypeDetermines the aggregation type.
summaryPositionSummaryRowPositionIndicates the position of the DataGridViewSummaryRow.
groupFromColDataGridViewColumnFirst column that determines the group break values.
groupToColDataGridViewColumnLast column that determines the group break values.
summaryColDataGridViewColumnColumn to aggregate.
style optionalDataGridViewCellStyleOptional DataGridViewCellStyle for the summary rows.
customSummary optionalCustomSummaryOptional custom summary function, used when summaryType is Custom.

Returns: DataGridViewSummaryRow[]. Array of the DataGridViewSummaryRow rows displaying the aggregated values.

Instance member Append(data, dataMember)

Populates the DataGridView from the data appending the rows to the existing rows.

ParameterTypeDescription
dataObjectThe object that contains data for the DataGridView to display.
dataMember optionalStringThe name of the table or list in the data object for which the DataGridView should load the data.

Returns: Int32. Numbers of rows appended.

Use this method to fill a DataGridView without binding it to the data source.

Instance member AreAllCellsSelected(includeInvisibleCells)

Returns whether all the cells are currently selected.

ParameterTypeDescription
includeInvisibleCellsBooleantrue to include the rows and columns with the Visible property set to false.

Returns: Boolean. true if all cells (or all visible cells) are selected or if there are no cells (or no visible cells); otherwise, returns false.

Instance member AutoResizeColumn(columnIndex)

Adjusts the width of the column to fit the contents of its cells including the header cell.

ParameterTypeDescription
columnIndexInt32The index of the column to resize; -1 indicates all columns.

Throws:

Instance member AutoResizeColumn(columnIndex, extraSpace)

Adjusts the width of the column to fit the contents of its cells including the header cell.

ParameterTypeDescription
columnIndexInt32The index of the column to resize; -1 indicates all columns.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeColumn(columnIndex, autoSizeMode)

Adjusts the width of the specified column using the specified size mode.

ParameterTypeDescription
columnIndexInt32The index of the column to resize; -1 indicates all columns.
autoSizeModeDataGridViewAutoSizeColumnModeOne of the DataGridViewAutoSizeColumnMode values.

Throws:

Instance member AutoResizeColumn(columnIndex, autoSizeMode, extraSpace)

Adjusts the width of the specified column using the specified size mode.

ParameterTypeDescription
columnIndexInt32The index of the column to resize; -1 indicates all columns.
autoSizeModeDataGridViewAutoSizeColumnModeOne of the DataGridViewAutoSizeColumnMode values.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeColumnHeadersHeight()

Adjusts the height of the column headers to fit the contents of the largest header.

Instance member AutoResizeColumnHeadersHeight(columnIndex)

Adjusts the height of the column headers based on the contents of the header in the specified column.

ParameterTypeDescription
columnIndexInt32The index of the column to resize; -1 indicates all columns.

Throws:

Instance member AutoResizeColumns()

Adjusts the width of all columns to fit the contents of their cells including the header cells.

Instance member AutoResizeColumns(extraSpace)

Adjusts the width of all columns to fit the contents of their cells including the header cells.

ParameterTypeDescription
extraSpaceInt32Additional space in pixels.

Instance member AutoResizeColumns(autoSizeMode)

Adjusts the width of all columns using the specified size mode.

ParameterTypeDescription
autoSizeModeDataGridViewAutoSizeColumnsModeOne of the DataGridViewAutoSizeColumnsMode values.

Throws:

Instance member AutoResizeColumns(autoSizeMode, extraSpace)

Adjusts the width of all columns using the specified size mode.

ParameterTypeDescription
autoSizeModeDataGridViewAutoSizeColumnsModeOne of the DataGridViewAutoSizeColumnsMode values.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeRow(rowIndex)

Adjusts the height of the row to fit the contents of all its cells including the header cell.

ParameterTypeDescription
rowIndexInt32The index of the row to resize.

Throws:

Instance member AutoResizeRow(rowIndex, extraSpace)

Adjusts the height of the row to fit the contents of all its cells including the header cell.

ParameterTypeDescription
rowIndexInt32The index of the row to resize.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeRow(rowIndex, autoSizeMode)

Adjusts the height of the row using the specified size mode.

ParameterTypeDescription
rowIndexInt32The index of the row to resize.
autoSizeModeDataGridViewAutoSizeRowModeOne of the DataGridViewAutoSizeRowMode values.

Throws:

Instance member AutoResizeRow(rowIndex, autoSizeMode, extraSpace)

Adjusts the height of the row using the specified size mode.

ParameterTypeDescription
rowIndexInt32The index of the row to resize.
autoSizeModeDataGridViewAutoSizeRowModeOne of the DataGridViewAutoSizeRowMode values.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeRowHeadersWidth(autoSizeMode)

Adjusts the width of the row headers using the specified size mode.

ParameterTypeDescription
autoSizeModeDataGridViewRowHeadersWidthSizeModeOne of the DataGridViewRowHeadersWidthSizeMode values.

Throws:

Instance member AutoResizeRowHeadersWidth(autoSizeMode, extraSpace)

Adjusts the width of the row headers using the specified size mode.

ParameterTypeDescription
autoSizeModeDataGridViewRowHeadersWidthSizeModeOne of the DataGridViewRowHeadersWidthSizeMode values.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeRowHeadersWidth(rowIndex, autoSizeMode)

Adjusts the width of the row headers based on the contents of the header in the specified row and using the specified size mode.

ParameterTypeDescription
rowIndexInt32The index of the row header with the changed content.
autoSizeModeDataGridViewRowHeadersWidthSizeModeOne of the DataGridViewRowHeadersWidthSizeMode values.

Throws:

Instance member AutoResizeRowHeadersWidth(rowIndex, autoSizeMode, extraSpace)

Adjusts the width of the row headers based on the contents of the header in the specified row and using the specified size mode.

ParameterTypeDescription
rowIndexInt32The index of the row header with the changed content.
autoSizeModeDataGridViewRowHeadersWidthSizeModeOne of the DataGridViewRowHeadersWidthSizeMode values.
extraSpaceInt32Additional space in pixels.

Throws:

Instance member AutoResizeRows()

Adjusts the heights of all rows in the client's data cache to fit the contents of all their cells, including the header cells.

Instance member AutoResizeRows(extraSpace)

Adjusts the heights of all rows in the client's data cache to fit the contents of all their cells, including the header cells.

ParameterTypeDescription
extraSpaceInt32Additional space in pixels.

Instance member AutoResizeRows(autoSizeMode)

Adjusts the heights of the rows using the specified size mode.

ParameterTypeDescription
autoSizeModeDataGridViewAutoSizeRowsModeOne of the DataGridViewAutoSizeRowMode values.

Throws:

Instance member BeginEdit(selectAll)

Puts the current cell in edit mode.

ParameterTypeDescription
selectAll optionalBooleantrue to select all the cell's contents; false to not select any contents.

Returns: Boolean. true if the current cell is already in edit mode or successfully enters edit mode; otherwise, false.

Throws:

Instance member BeginUpdate()

Prevents the control from updating until the EndUpdate method is called.

Instance member CancelEdit()

Cancels edit mode for the currently selected cell and discards any changes.

Returns: Boolean. true if the cancel was successful; otherwise, false.

Instance member CanSort(sortColumn)

Returns whether the specified column can be sorted automatically.

ParameterTypeDescription
sortColumnDataGridViewColumnColumn being sorted.

Returns: Boolean. true if the DataGridView should sort the data.

Instance member ClearSelection()

Clears the current selection.

Instance member CommitEdit()

Commits changes to cell without ending edit mode.

Returns: Boolean. true if the changes were committed; otherwise false.

Throws:

  • Exception The cell value could not be committed and either there is no handler for the DataError event or the handler has set the ThrowException property to true.

Instance member CreateDataBoundColumn(property, name)

Creates a new DataGridViewColumn bound to the specified property .

ParameterTypeDescription
propertyPropertyDescriptorProperty bound this the column being created.
nameStringProposes safe name for the new column.

Returns: DataGridViewColumn.

Override this method to manage the automatic creation of data-bound columns. The default implementation calls CreateDataGridViewColumnFromType using the PropertyType to create a compatible column.

Instance member CreateDataGridViewColumnFromType(type)

Creates a new DataGridViewColumn that matches the data field type.

ParameterTypeDescription
typeTypeType of the data field that will be displayed in the new column.

Returns: DataGridViewColumn. New DataGridViewColumn compatible with the specified type .

Override this method to manage the automatic creation of data-bound columns.

Instance member CreateSummaryRow(group, summaryPosition, groupFromCol, groupToCol, style)

Invoked by all the AddSummaryRows methods to create a new DataGridViewSummaryRow in relation to the specified group .

ParameterTypeDescription
groupDataGridViewRow[]An array of the DataGridViewRow summarized by the group row being created.
summaryPositionSummaryRowPositionThe SummaryRowPosition indicated by the AddSummaryRows method call.
groupFromColDataGridViewColumnThe first DataGridViewColumn delimiting the group.
groupToColDataGridViewColumnThe last DataGridViewColumn delimiting the group.
styleDataGridViewCellStyleA DataGridViewCellStyle for the summary row; can be null.

Returns: DataGridViewSummaryRow.

Override this method to create a custom derived class from DataGridViewSummaryRow.

Protected member Dispose(disposing)

Disposes the control and all the owned columns.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member EndEdit()

Commits and ends the edit operation on the current cell.

Returns: Boolean. true if the edit operation is committed and ended; otherwise, false.

Throws:

  • Exception The cell value could not be committed and either there is no handler for the DataError event or the handler has set the ThrowException property to true.

Instance member EndUpdate()

Resumes updating of the control after it was suspended by the BeginUpdate method.

Instance member Fill(data, dataMember)

Populates the DataGridView from the data .

ParameterTypeDescription
dataObjectThe object that contains data for the DataGridView to display.
dataMember optionalStringThe name of the table or list in the data object for which the DataGridView should load the data.

Returns: Int32. Numbers of rows added.

Use this method to fill a DataGridView without binding it to the data source.

Instance member GetClipboardContent()

Returns the formatted values that represent the contents of the selected cells for copying to the Clipboard.

Returns: DataObject. A DataObject with the contents of the selected cells.

Throws:

Instance member GetCommand(columnIndex, rowIndex)

Retrieves the command for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnIndexInt32The index of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: ICommand. The object value stored in the cell.

Throws:

Instance member GetCommand(cellAddress)

Retrieves the command for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
cellAddressPointRow and column index of the cell.

Returns: ICommand. The object value stored in the cell.

Throws:

Instance member GetCommand(column, rowIndex)

Retrieves the command for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumn that contains the cell.
rowIndexInt32The index of the row containing the cell.

Returns: ICommand. The object value stored in the cell.

Throws:

Instance member GetCommand(columnName, rowIndex)

Retrieves the command for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnNameStringThe Name of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: ICommand. The object value stored in the cell.

Throws:

Instance member GetFormattedValue(columnIndex, rowIndex)

Retrieves the value for the specified cell, as formatted for display, without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnIndexInt32The index of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The formatted value stored in the cell.

Throws:

Instance member GetFormattedValue(column, rowIndex)

Retrieves the value for the specified cell, as formatted for display, without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumn that contains the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The formatted value stored in the cell.

Throws:

Instance member GetFormattedValue(columnName, rowIndex)

Retrieves the value for the specified cell, as formatted for display, without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnNameStringThe Name of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The formatted value stored in the cell.

Throws:

Instance member GetRowState(rowIndex)

Returns the state of the DataGridViewRow at the specified index.

ParameterTypeDescription
rowIndexInt32The index of the row.

Returns: DataGridViewElementStates. A combination of DataGridViewElementStates values indicating the state of the row.

Throws:

Instance member GetValue(columnIndex, rowIndex)

Retrieves the value for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnIndexInt32The index of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The object value stored in the cell.

Throws:

Instance member GetValue(cellAddress)

Retrieves the value for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
cellAddressPointRow and column index of the cell.

Returns: Object. The object value stored in the cell.

Throws:

Instance member GetValue(column, rowIndex)

Retrieves the value for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumn that contains the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The object value stored in the cell.

Throws:

Instance member GetValue(columnName, rowIndex)

Retrieves the value for the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnNameStringThe Name of the column containing the cell.
rowIndexInt32The index of the row containing the cell.

Returns: Object. The object value stored in the cell.

Throws:

Instance member HitTest(x, y)

Returns the column index and row index that contain the specified x, y client coordinates.

ParameterTypeDescription
xInt32The x coordinate relative to the DataGridView control.
yInt32The y coordinate relative to the DataGridView control.

Returns: HitTestInfo. A HitTestInfo that contains the column index and row index information.

Instance member HitTest(position)

Returns the column index and row index that contain the specified x, y client coordinates.

ParameterTypeDescription
positionPointThe x, y coordinate relative to the DataGridView control.

Returns: HitTestInfo. A HitTestInfo that contains the column index and row index information.

Instance member IsCellEditable(cell)

Checks if the specified cell can enter edit mode.

ParameterTypeDescription
cellDataGridViewCellCell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsCellEditable(colIndex, rowIndex)

Checks if the cell at the colIndex and rowIndex location can enter edit mode.

ParameterTypeDescription
colIndexInt32The column index of the cell to verify.
rowIndexInt32The row index of the cell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsCellEditable(cellAddress)

Checks if the cell at the cellAddress location can enter edit mode.

ParameterTypeDescription
cellAddressPointCoordinates of the cell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsCellEmpty(cell)

Checks if the cell contains a value. Since 4.0.9

ParameterTypeDescription
cellDataGridViewCellCoordinates of the cell to verify.

Returns: Boolean. true is the specified cell specifies a value.

Instance member IsCellEmpty(cellAddress)

Checks if the cell at the cellAddress location contains a value. Since 4.0.9

ParameterTypeDescription
cellAddressPointCoordinates of the cell to verify.

Returns: Boolean. true is the specified cell specifies a value.

Instance member IsCellEmpty(colIndex, rowIndex)

Checks if the cell at the colIndex and rowIndex location contains a value. Since 4.0.9

ParameterTypeDescription
colIndexInt32The column index of the cell to verify.
rowIndexInt32The row index of the cell to verify.

Returns: Boolean. true is the specified cell specifies a value.

Instance member IsCellVisible(cell)

Checks if the specified cell is visible.

ParameterTypeDescription
cellDataGridViewCellCell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsCellVisible(colIndex, rowIndex)

Checks if the cell at the colIndex and rowIndex location is visible.

ParameterTypeDescription
colIndexInt32The column index of the cell to verify.
rowIndexInt32The row index of the cell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsCellVisible(cellAddress)

Checks if the cell at the cellAddress location is visible.

ParameterTypeDescription
cellAddressPointCoordinates of the cell to verify.

Returns: Boolean. true is the specified cell, the owner row, owner column and the data source, allow user editing.

Instance member IsValidCell(cellAddress)

Verifies that the cell address refers to a valid cell.

ParameterTypeDescription
cellAddressPointCell address to verify.

Returns: Boolean. true if the coordinates correspond to a valid cell address.

Instance member IsValidCell(colIndex, rowIndex)

Verifies that the column index and row index refer to a valid cell.

ParameterTypeDescription
colIndexInt32The index of the column to verify.
rowIndexInt32The index of the row to verify.

Returns: Boolean. true if the coordinates correspond to a valid cell address.

Instance member IsValidColumn(colIndex)

Verifies that the column index refer to a valid column.

ParameterTypeDescription
colIndexInt32The index of the column to verify.

Returns: Boolean. true if the column index corresponds to a valid column.

Instance member IsValidRow(rowIndex)

Verifies that the row index refer to a valid row.

ParameterTypeDescription
rowIndexInt32The index of the row to verify.

Returns: Boolean. true if the row index corresponds to a valid row.

Instance member NotifyCurrentCellDirty(dirty)

Notifies the DataGridView that the current cell has uncommitted changes.

ParameterTypeDescription
dirtyBooleanTrue to indicate the cell has uncommitted changes; otherwise, false.

Protected member OnAddReferences(items)

Returns a collection of referenced components or collection of components.

ParameterTypeDescription
itemsIList

Protected member OnAllowUserToAddRowsChanged(e)

Fires the AllowUserToAddRowsChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnAllowUserToDeleteRowsChanged(e)

Fires the AllowUserToDeleteRowsChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnAllowUserToOrderColumnsChanged(e)

Fires the AllowUserToOrderColumnsChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnAllowUserToResizeColumnsChanged(e)

Fires the AllowUserToResizeColumnsChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnAllowUserToResizeRowsChanged(e)

Fires the AllowUserToResizeRowsChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnAutoGenerateColumnsChanged(e)

Fires the AutoGenerateColumnsChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnAutoSizingColumnsComplete(e)

Fires the AutoSizingColumnsComplete event. Since 4.0.3

ParameterTypeDescription
eEventArgs

Protected member OnAutoSizingRowsComplete(e)

Fires the AutoSizingRowsComplete event. Since 4.0.3

ParameterTypeDescription
eEventArgs

Protected member OnBindingContextChanged(e)

Fires the BindingContextChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnCellBeginEdit(e)

Fires the CellBeginEdit event.

ParameterTypeDescription
eDataGridViewCellCancelEventArgsA DataGridViewCellCancelEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellClick(e)

Fires the CellClick event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

Protected member OnCellCommandChanged(e)

Fires the CellCommandChanged event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

Protected member OnCellCommandNeeded(e)

Fires the CellCommandNeeded event.

ParameterTypeDescription
eDataGridViewCellCommandEventArgsA DataGridViewCellCommandEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellCommandPushed(e)

Fires the CellCommandPushed event.

ParameterTypeDescription
eDataGridViewCellCommandEventArgsA DataGridViewCellCommandEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellContextMenuNeeded(e)

Fires the CellContextMenuNeeded event.

ParameterTypeDescription
eDataGridViewCellContextMenuNeededEventArgsA DataGridViewCellContextMenuNeededEventArgs that contains the event data.

Throws:

Protected member OnCellDoubleClick(e)

Fires the CellDoubleClick event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

Protected member OnCellEndEdit(e)

Fires the CellEndEdit event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellEnter(e)

Fires the CellEnter event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellErrorTextChanged(e)

Fires the CellErrorTextChanged event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than -1 or greater than the number of columns in the control. Or the value of the RowIndex property of e is less than -1 or greater than the number of rows in the control.

Protected member OnCellErrorTextNeeded(e)

Fires the CellErrorTextNeeded event.

ParameterTypeDescription
eDataGridViewCellErrorTextNeededEventArgsA DataGridViewCellErrorTextNeededEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is greater than the number of columns in the control minus one; or the value of the RowIndex property of e is greater than the number of rows in the control minus one.

Protected member OnCellFormatting(e)

Fires the CellFormatting event.

ParameterTypeDescription
eDataGridViewCellFormattingEventArgsA DataGridViewCellFormattingEventArgs that contains the event data.

Throws:

Protected member OnCellLeave(e)

Fires the CellLeave event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellMouseClick(e)

Fires the CellMouseClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnCellMouseDoubleClick(e)

Fires the CellMouseDoubleClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnCellMouseDown(e)

Fires the CellMouseDown event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnCellMouseEnter(e)

Fires the CellMouseEnter event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event. Throws:

Protected member OnCellMouseLeave(e)

Fires the CellMouseLeave event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event. Throws:

Protected member OnCellMouseMove(e)

Fires the CellMouseMove event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event. Throws:

Protected member OnCellMouseUp(e)

Fires the CellMouseUp event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnCellPaint(e)

Fires the CellPaint event.

ParameterTypeDescription
eDataGridViewCellPaintEventArgsA DataGridViewCellPaintEventArgs that contains the event data.

Throws:

Protected member OnCellParsing(e)

Fires the CellParsing event.

ParameterTypeDescription
eDataGridViewCellParsingEventArgsA DataGridViewCellParsingEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellStateChanged(e)

Fires the CellStateChanged event.

ParameterTypeDescription
eDataGridViewCellStateChangedEventArgsA DataGridViewCellStateChangedEventArgs that contains the event data.

Protected member OnCellStyleChanged(e)

Fires the CellStyleChanged event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is greater than the number of columns in the control minus one; or the value of the RowIndex property of e is greater than the number of rows in the control minus one.

Protected member OnCellStyleContentChanged(e)

Fires the CellStyleContentChanged event.

ParameterTypeDescription
eDataGridViewCellStyleContentChangedEventArgsA DataGridViewCellStyleContentChangedEventArgs that contains the event data.

Protected member OnCellToolClick(e)

Fires the ToolClick event.

ParameterTypeDescription
eDataGridViewToolClickEventArgsA DataGridViewToolClickEventArgs that contains the event data.

Throws:

Protected member OnCellToolTipTextChanged(e)

Fires the CellToolTipTextChanged event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than -1 or greater than the number of columns in the control. Or the value of the RowIndex property of e is less than -1 or greater than the number of rows in the control.

Protected member OnCellToolTipTextNeeded(e)

Fires the CellToolTipTextNeeded event.

ParameterTypeDescription
eDataGridViewCellToolTipTextNeededEventArgsA DataGridViewCellToolTipTextNeededEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is greater than the number of columns in the control minus one; or the value of the RowIndex property of e is greater than the number of rows in the control minus one.

Protected member OnCellValidated(e)

Fires the CellValidated event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellValidating(e)

Fires the CellValidating event.

ParameterTypeDescription
eDataGridViewCellValidatingEventArgsA DataGridViewCellValidatingEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellValueChanged(e)

Fires the CellValueChanged event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

Protected member OnCellValueNeeded(e)

Fires the CellValueNeeded event.

ParameterTypeDescription
eDataGridViewCellValueEventArgsA DataGridViewCellValueEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnCellValuePushed(e)

Fires the CellValuePushed event.

ParameterTypeDescription
eDataGridViewCellValueEventArgsA DataGridViewCellValueEventArgs that contains the event data.

Throws:

  • ArgumentOutOfRangeException The value of the ColumnIndex property of e is less than zero or greater than the number of columns in the control, or the value of the RowIndex property of e is less than zero or greater than the number of rows in the control.

Protected member OnColumnAdded(e)

Raises the ColumnAdded event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Throws:

Protected member OnColumnDisplayIndexChanged(e)

Fires the ColumnDisplayIndexChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Throws:

Protected member OnColumnFillWeightChanged(e)

Raises the ColumnFillWeightChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Throws:

Protected member OnColumnHeaderMouseClick(e)

Fires the ColumnHeaderMouseClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnColumnHeaderMouseDoubleClick(e)

Fires the ColumnHeaderMouseDoubleClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains information about the cell and the position of the mouse pointer.

Throws:

Protected member OnColumnHeadersHeightChanged(e)

Fires the ColumnHeadersHeightChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnColumnMaximumWidthChanged(e)

Fires the ColumnMaximumWidthChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Protected member OnColumnMinimumWidthChanged(e)

Fires the ColumnMinimumWidthChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Protected member OnColumnNameChanged(e)

Raises the ColumnNameChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Throws:

Protected member OnColumnRemoved(e)

Fires the ColumnRemoved event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Protected member OnColumnSortModeChanged(e)

Fires the ColumnSortModeChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Protected member OnColumnStateChanged(e)

Fires the ColumnStateChanged event.

ParameterTypeDescription
eDataGridViewColumnStateChangedEventArgsA DataGridViewColumnStateChangedEventArgs that contains the event data.

Protected member OnColumnWidthChanged(e)

Raises the ColumnWidthChanged event.

ParameterTypeDescription
eDataGridViewColumnEventArgsA DataGridViewColumnEventArgs that contains the event data.

Throws:

Protected member OnControlAdded(e)

Fires the ControlAdded event.

ParameterTypeDescription
eControlEventArgsA ControlEventArgs that contains the event data.

Protected member OnControlCreated(e)

Fires the ControlCreated event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnControlRemoved(e)

Fires the ControlRemoved event.

ParameterTypeDescription
eControlEventArgsA ControlEventArgs that contains the event data.

Protected member OnCurrentCellChanged(e)

Fires the CurrentCellChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnDataBindingComplete(e)

Fires the DataBindingComplete event.

ParameterTypeDescription
eDataGridViewBindingCompleteEventArgsA DataGridViewBindingCompleteEventArgs that contains the event data.

Protected member OnDataError(e)

Fires the DataError event.

ParameterTypeDescription
eDataGridViewDataErrorEventArgsA DataGridViewDataErrorEventArgs that contains the event data.

Protected member OnDataError(displayErrorIfNoHandler, e)

Fires the DataError event.

ParameterTypeDescription
displayErrorIfNoHandlerBooleantrue to display an error dialog box if there is no handler for the DataError event.
eDataGridViewDataErrorEventArgsA DataGridViewDataErrorEventArgs that contains the event data.

Protected member OnDataMemberChanged(e)

Fires the DataMemberChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnDataRead(e)

Fires the DataRead event.

ParameterTypeDescription
eDataGridViewDataReadEventArgsEvent data.

Protected member OnDataSourceChanged(e)

Fires the DataSourceChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnDataUpdated(e)

Fires the DataUpdated event.

ParameterTypeDescription
eDataGridViewDataUpdatedEventArgsA DataGridViewDataUpdatedEventArgs that contains the event data.

Protected member OnDefaultCellStyleChanged(e)

Fires the DefaultCellStyleChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnDefaultRowHeightChanged(e)

Fires the DefaultRowHeightChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnDefaultValuesNeeded(e)

Fires the DefaultValuesNeeded event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnEditingControlShowing(e)

Fires the EditingControlShowing event.

ParameterTypeDescription
eDataGridViewEditingControlShowingEventArgsA DataGridViewEditingControlShowingEventArgs that contains information about the editing control.

Protected member OnEditModeChanged(e)

Fires the EditModeChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnEnter(e)

Fires the Enter event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnKeyDown(e)

Fires the KeyDown event.

ParameterTypeDescription
eKeyEventArgsA KeyEventArgs that contains the event data.

Protected member OnLastCellTab(e)

Fires the LastCellTab event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Throws:

Protected member OnLeave(e)

Fires the Leave event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnMouseUp(e)

Fires the MouseUp event.

ParameterTypeDescription
eMouseEventArgsA MouseEventArgs that contains the event data.

Protected member OnMultiSelectChanged(e)

Fires the MultiSelectChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnNewRowNeeded(e)

Raises the NewRowNeeded event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnReadOnlyChanged(e)

Fires the ReadOnlyChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Throws:

Protected member OnRowCollapsed(e)

Fires the RowExpanded event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Throws:

Protected member OnRowEnter(e)

Fires the RowEnter event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Protected member OnRowErrorTextChanged(e)

Fires the RowErrorTextChanged event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnRowErrorTextNeeded(e)

Fires the RowErrorTextNeeded event.

ParameterTypeDescription
eDataGridViewRowErrorTextNeededEventArgsA DataGridViewRowErrorTextNeededEventArgs that contains the event data.

Protected member OnRowExpanded(e)

Fires the RowExpanded event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Throws:

Protected member OnRowHeaderMouseClick(e)

Fires the RowHeaderMouseClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains information about the mouse and the header cell that was clicked.

Protected member OnRowHeaderMouseDoubleClick(e)

Fires the RowHeaderMouseDoubleClick event.

ParameterTypeDescription
eDataGridViewCellMouseEventArgsA DataGridViewCellMouseEventArgs that contains information about the mouse and the header cell that was double-clicked.

Throws:

Protected member OnRowHeadersWidthChanged(e)

Fires the RowHeadersWidthChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnRowHeightChanged(e)

Raises the RowHeightChanged event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnRowHeightInfoNeeded(e)

Fires the RowHeightInfoNeeded event.

ParameterTypeDescription
eDataGridViewRowHeightInfoNeededEventArgsA DataGridViewRowHeightInfoNeededEventArgs that contains the event data.

Protected member OnRowLeave(e)

Fires the RowLeave event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Protected member OnRowMaximumHeightChanged(e)

Fires the RowMaximumHeightChanged event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnRowMinimumHeightChanged(e)

Fires the RowMinimumHeightChanged event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnRowsAdded(e)

Fires the RowsAdded event.

ParameterTypeDescription
eDataGridViewRowsAddedEventArgsA DataGridViewRowsAddedEventArgs that contains information about the added rows.

Protected member OnRowsRemoved(e)

Fires the RowsRemoved event.

ParameterTypeDescription
eDataGridViewRowsRemovedEventArgsA DataGridViewRowsRemovedEventArgs that contains information about the deleted rows.

Protected member OnRowStateChanged(e)

Fires the RowStateChanged event.

ParameterTypeDescription
eDataGridViewRowStateChangedEventArgsA DataGridViewRowStateChangedEventArgs that contains the event data.

Protected member OnRowValidated(e)

Fires the RowValidated event.

ParameterTypeDescription
eDataGridViewCellEventArgsA DataGridViewCellEventArgs that contains the event data.

Protected member OnRowValidating(e)

Fires the RowValidating event.

ParameterTypeDescription
eDataGridViewCellCancelEventArgsA DataGridViewCellCancelEventArgs that contains the event data.

Protected member OnScroll(e)

Fires the Scroll event.

ParameterTypeDescription
eScrollEventArgsA ScrollEventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Protected member OnSelectionChanged(e)

Fires the SelectionChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains information about the event.

Protected member OnSortCompare(e)

Fires the SortCompare event.

ParameterTypeDescription
eDataGridViewSortCompareEventArgsA DataGridViewSortCompareEventArgs that contains the event data.

Protected member OnSorted(e)

Fires the Sorted event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnToolClick(e)

Fires the ToolClick event.

ParameterTypeDescription
eToolClickEventArgsA ToolClickEventArgs that contains the event data.

Instance member OnTopLeftHeaderClick(e)

Fires the TopLeftHeaderClick event, if MultiSelect is true, selects all the rows in the control.

ParameterTypeDescription
eDataGridViewCellCancelEventArgsA DataGridViewCellMouseEventArgs that contains the event data.

Throws:

Protected member OnUserAddedRow(e)

Fires the UserAddedRow event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnUserDeletedRow(e)

Fires the UserDeletedRow event.

ParameterTypeDescription
eDataGridViewRowEventArgsA DataGridViewRowEventArgs that contains the event data.

Protected member OnUserDeletingRow(e)

Fires the UserDeletingRow event.

ParameterTypeDescription
eDataGridViewRowCancelEventArgsA DataGridViewRowCancelEventArgs that contains the event data.

Protected member OnValidating(e)

Process the Validating event on the current cell and pass the event invocation back to the grid.

ParameterTypeDescription
eCancelEventArgsA CancelEventArgs that contains the event data.

Throws:

Protected member OnWebDataCount()

Returns the number of available data rows.

Returns: Int32.

Protected member OnWebDataRead(firstIndex, lastIndex, sortDirection, sortIndex)

Returns the data requested by the client.

ParameterTypeDescription
firstIndexInt32The index of the first requested row.
lastIndexInt32The index of the last requested row.
sortDirectionListSortDirectionThe sort direction.
sortIndexInt32The index of the sorted column. Can be -1 if there is no sorted column.

Returns: Object.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Protected member OnWebUpdate(state)

Updates the client component using the state information.

ParameterTypeDescription
stateObjectDynamic state object.

Protected member ProcessDialogKey(keyData)

Processes a dialog key.

ParameterTypeDescription
keyDataKeysOne of the Keys values that represents the key to process.

Returns: Boolean. true if the key was processed by the control; otherwise, false.

Instance member Refresh()

Forces a full reload of the data displayed by this DataGridView.

Instance member Refresh(refreshChildren)

Forces a full reload of the data displayed by this DataGridView.

ParameterTypeDescription
refreshChildrenBooleanTrue to also refresh all the children of this control.

Instance member RemoveSummaryRows()

Removes the all the summary rows.

Instance member RemoveSummaryRows(summaryPosition)

Removes the summary rows that match the specified summaryPosition .

ParameterTypeDescription
summaryPositionSummaryRowPositionPosition of the summary rows to remove.

Instance member RemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

ParameterTypeDescription
groupFromColStringName of the first column that determines the group break values.

Instance member RemoveSummaryRows(groupFromCol, groupToCol)

Removes the summary rows grouped by groupFromCol and groupToCol .

ParameterTypeDescription
groupFromColStringName of the first column that determines the group break values.
groupToColStringName of the last column that determines the group break values.

Instance member RemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

ParameterTypeDescription
groupFromColDataGridViewColumnFirst column that determines the group break values.

Instance member RemoveSummaryRows(groupFromCol, groupToCol)

Removes the summary rows grouped by groupFromCol and groupToCol .

ParameterTypeDescription
groupFromColDataGridViewColumnFirst column that determines the group break values.
groupToColDataGridViewColumnLast column that determines the group break values.

Instance member RemoveSummaryRows(summaryPosition, groupFromCol)

Removes the summary rows that match the specified summaryPosition and grouped by groupFromCol .

ParameterTypeDescription
summaryPositionSummaryRowPositionPosition of the summary rows to remove.
groupFromColStringName of the first column that determines the group break values.

Instance member RemoveSummaryRows(summaryPosition, groupFromCol, groupToCol)

Removes the summary rows that match the specified summaryPosition and grouped by groupFromCol and groupToCol .

ParameterTypeDescription
summaryPositionSummaryRowPositionPosition of the summary rows to remove.
groupFromColStringName of the first column that determines the group break values.
groupToColStringName of the last column that determines the group break values.

Instance member RemoveSummaryRows(summaryPosition, groupFromCol, groupToCol)

Removes the summary rows that match the specified summaryPosition and grouped by groupFromCol and groupToCol .

ParameterTypeDescription
summaryPositionSummaryRowPositionPosition of the summary rows to remove.
groupFromColDataGridViewColumnFirst column that determines the group break values.
groupToColDataGridViewColumnLast column that determines the group break values.

Instance member ScrollCellIntoView(cell)

Scrolls the specified cell into view.

ParameterTypeDescription
cellDataGridViewCellThe DataGridViewCell to scroll into view.

Throws:

Instance member ScrollCellIntoView(cell, alignX, alignY)

Scrolls the specified cell into view aligned according to the position specified by alignX and alignY , if possible.

ParameterTypeDescription
cellDataGridViewCellThe DataGridViewCell to scroll into view.
alignXPositionOne of Left or Right. Any other value is ignored and will use the least-effort alignment.
alignYPositionOne of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

Instance member ScrollCellIntoView(cellAddress)

Scrolls the specified cell into view.

ParameterTypeDescription
cellAddressPointThe address of the cell to scroll into view.

Throws:

  • ArgumentOutOfRangeException cellAddress .X is less than -1 or greater than the number of columns in the control, or cellAddress .Y is less than -1 or greater than the number of rows in the control.

Instance member ScrollCellIntoView(cellAddress, alignX, alignY)

Scrolls the specified cell into view aligned according to the position specified by alignX and alignY , if possible.

ParameterTypeDescription
cellAddressPointThe address of the cell to scroll into view.
alignXPositionOne of Left or Right. Any other value is ignored and will use the least-effort alignment.
alignYPositionOne of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

  • ArgumentOutOfRangeException cellAddress .X is less than -1 or greater than the number of columns in the control, or cellAddress .Y is less than -1 or greater than the number of rows in the control.

Instance member ScrollCellIntoView(columnIndex, rowIndex)

Scrolls the specified cell into view.

ParameterTypeDescription
columnIndexInt32The zero-based column index of the cell to scroll into view.
rowIndexInt32The zero-based row index of the cell to scroll into view.

Throws:

  • ArgumentOutOfRangeException columnIndex is less than -1 or greater than the number of columns in the control, or rowIndex is less than -1 or greater than the number of rows in the control.

Instance member ScrollCellIntoView(columnIndex, rowIndex, alignX, alignY)

Scrolls the specified cell into view aligned according to the position specified by alignX and alignY , if possible.

ParameterTypeDescription
columnIndexInt32The zero-based column index of the cell to scroll into view.
rowIndexInt32The zero-based row index of the cell to scroll into view.
alignXPositionOne of Left or Right. Any other value is ignored and will use the least-effort alignment.
alignYPositionOne of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

  • ArgumentOutOfRangeException columnIndex is less than -1 or greater than the number of columns in the control, or rowIndex is less than -1 or greater than the number of rows in the control.

Instance member ScrollColumnIntoView(columnIndex)

Scrolls the specified column into view.

ParameterTypeDescription
columnIndexInt32The zero-based column index of the cell to scroll into view.

Throws:

Instance member ScrollColumnIntoView(columnIndex, alignX)

Scrolls the specified column into view aligned to the left or right according to the position specified by alignX .

ParameterTypeDescription
columnIndexInt32The zero-based column index of the cell to scroll into view.
alignXPositionOne of Left or Right. Any other value is ignored and will use the least-effort alignment.

Throws:

Instance member ScrollColumnIntoView(column)

Scrolls the specified column into view.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumnto scroll into view.

Throws:

Instance member ScrollColumnIntoView(column, alignX)

Scrolls the specified column into view aligned to the left or right according to position specified by alignX .

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumnto scroll into view.
alignXPositionOne of Left or Right. Any other value is ignored and will use the least-effort alignment.

Throws:

Instance member ScrollRowIntoView(rowIndex)

Scrolls the specified row into view.

ParameterTypeDescription
rowIndexInt32The zero-based row index of the cell to scroll into view.

Throws:

Instance member ScrollRowIntoView(rowIndex, alignY)

Scrolls the specified row into view aligned to the top or bottom according to the position specified by alignY .

ParameterTypeDescription
rowIndexInt32The zero-based row index of the cell to scroll into view.
alignYPositionOne of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

Instance member ScrollRowIntoView(row)

Scrolls the specified row into view.

ParameterTypeDescription
rowDataGridViewRowThe DataGridViewRowto scroll into view.

Throws:

Instance member ScrollRowIntoView(row, alignY)

Scrolls the specified row into view aligned to the top or bottom according to the position specified by alignY .

ParameterTypeDescription
rowDataGridViewRowThe DataGridViewRowto scroll into view.
alignYPositionOne of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

Instance member SelectAll()

Selects all the cells, or rows, or columns, according to the SelectionMode property when the MultiSelect is true.

Instance member SelectAllCells()

Selects all the cells, regardless of the SelectionMode and MultiSelect properties.

Instance member SelectAllColumns()

Selects all the columns, regardless of the SelectionMode and MultiSelect properties.

Instance member SelectAllRows()

Selects all the rows, regardless of the SelectionMode and MultiSelect properties.

Protected member SelectCell(cellAddress)

Cancels the selection of all currently selected cells except the one indicated.

ParameterTypeDescription
cellAddressPointThe coordinates of cell to select.

Protected member SelectCell(columnIndex, rowIndex)

Cancels the selection of all currently selected cells except the one indicated.

ParameterTypeDescription
columnIndexInt32The zero-based column index of the cell to select.
rowIndexInt32The zero-based row index of the cell to select.

Throws:

  • ArgumentOutOfRangeException columnIndex is less than -1 or greater than the number of columns in the control, or rowIndex is less than -1 or greater than the number of rows in the control.

Instance member SetCommand(columnIndex, rowIndex, command)

Sets the command of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnIndexInt32The index of the column containing the cell.
rowIndexInt32The index of the row containing the cell.
commandICommandValue to store in the cell identified by columnIndex and rowIndex .

Throws:

Instance member SetCommand(cellAddress, command)

Sets the command of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
cellAddressPointRow and column index of the cell.
commandICommandValue to store in the cell identified by cellAddress .

Throws:

Instance member SetCommand(columnName, rowIndex, command)

Sets the command of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnNameStringThe Name of the column containing the cell.
rowIndexInt32The index of the row containing the cell.
commandICommandValue to store in the cell identified by columnName and rowIndex .

Throws:

Instance member SetCommand(column, rowIndex, command)

Sets the command of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumn that contains the cell.
rowIndexInt32The index of the row containing the cell.
commandICommandValue to store in the cell identified by column and rowIndex .

Throws:

Instance member SetCurrentCell(cellAddress)

Sets the currently focused cell.

ParameterTypeDescription
cellAddressPointAddress of the cell.

Instance member SetCurrentCell(columnIndex, rowIndex)

Sets the currently focused cell.

ParameterTypeDescription
columnIndexInt32Column index of the cell.
rowIndexInt32Row index of the cell.

Instance member SetRowState(rowIndex, state)

Sets the state for the row at rowIndex .

ParameterTypeDescription
rowIndexInt32The index of the row.
stateDataGridViewElementStatesDataGridViewElementStates state to set.

When using this method, the state parameter must contain all the states to set for the row. The best way to do this is to use GetRowState first and then OR or XOR or AND the state to alter. To set a specific state use SetRowState. Throws:

Instance member SetRowState(rowIndex, state, on)

Sets the state for the row at rowIndex .

ParameterTypeDescription
rowIndexInt32The index of the row.
stateDataGridViewElementStatesDataGridViewElementStates state to turn on or off.
onBooleanTrue to add the state , otherwise false to remove the state .

Throws:

Instance member SetValue(columnIndex, rowIndex, value)

Sets the value of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnIndexInt32The index of the column containing the cell.
rowIndexInt32The index of the row containing the cell.
valueObjectValue to store in the cell identified by columnIndex and rowIndex .

Throws:

Instance member SetValue(cellAddress, value)

Sets the value of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
cellAddressPointRow and column index of the cell.
valueObjectValue to store in the cell identified by cellAddress .

Throws:

Instance member SetValue(columnName, rowIndex, value)

Sets the value of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnNameStringThe Name of the column containing the cell.
rowIndexInt32The index of the row containing the cell.
valueObjectValue to store in the cell identified by columnName and rowIndex .

Throws:

Instance member SetValue(column, rowIndex, value)

Sets the value of the specified cell without retrieving a DataGridViewRow and without causing the permanent creation of a row instance. This method is particularly useful when the grid shows a large data set and/or it's operating in VirtualMode.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumn that contains the cell.
rowIndexInt32The index of the row containing the cell.
valueObjectValue to store in the cell identified by column and rowIndex .

Throws:

Instance member Sort(column, direction)

Sorts the contents of the DataGridView control in ascending or descending order based on the contents of the specified column.

ParameterTypeDescription
columnDataGridViewColumnThe column by which to sort the contents of the DataGridView.
directionListSortDirectionOne of the ListSortDirection values.

Throws:

Instance member Sort(comparer)

Sorts the contents of the DataGridView control using an implementation of the IComparer interface.

ParameterTypeDescription
comparerIComparerAn implementation of IComparer that performs the custom sorting operation.

Throws:

Instance member Update()

Causes the control to update the corresponding client side widget. When in design mode, causes the rendered control to update its entire surface in the designer.

Events

Instance member AllowUserToAddRowsChanged

EventHandler Fired when the value of the AllowUserToAddRows property changes.

Instance member AllowUserToDeleteRowsChanged

EventHandler Fired when the value of the AllowUserToDeleteRowsChanged property changes.

Instance member AllowUserToOrderColumnsChanged

EventHandler Fired when the value of the AllowUserToOrderColumns property changes.

Instance member AllowUserToResizeColumnsChanged

EventHandler Fired when the value of the AllowUserToResizeColumns property changes.

Instance member AllowUserToResizeRowsChanged

EventHandler Fired when the value of the AllowUserToResizeRows property changes.

Instance member AutoSizingColumnsComplete

EventHandler Fired when the auto-sizing operation on columns has completed. Since 4.0.3

Instance member AutoSizingRowsComplete

EventHandler Fired when the auto-sizing operation on rows has completed. Since 4.0.3

Instance member CellBeginEdit

DataGridViewCellCancelEventHandler Fired when edit mode starts for the selected cell.

Instance member CellClick

DataGridViewCellEventHandler Fired when any part of a cell is clicked.

Instance member CellCommandChanged

DataGridViewCellEventHandler Fired when the command of a cell changes.

Instance member CellCommandNeeded

DataGridViewCellCommandEventHandler Fired when the VirtualMode property of the DataGridView control is true and the DataGridView requires a command for a cell in order to execute a user action.

Instance member CellCommandPushed

DataGridViewCellCommandEventHandler Fired when the VirtualMode property of the DataGridView control is true and a cell command has changed and requires storage in the underlying data source.

Instance member CellContextMenuNeeded

DataGridViewCellContextMenuNeededEventHandler Fired when a cell's context menu is needed.

Instance member CellDoubleClick

DataGridViewCellEventHandler Fired when the user double-clicks anywhere in a cell.

Instance member CellEndEdit

DataGridViewCellEventHandler Fired when edit mode stops for the current cell.

Instance member CellEnter

DataGridViewCellEventHandler Fired when the current cell changes in the DataGridView control or when the control receives input focus.

Instance member CellErrorTextChanged

DataGridViewCellEventHandler Fired when the value of the ErrorText property of a cell changes.

Instance member CellErrorTextNeeded

DataGridViewCellErrorTextNeededEventHandler Fired when a cell's error text is needed.

Instance member CellFormatting

DataGridViewCellFormattingEventHandler Fired when the contents of a cell need to be formatted for display.

Instance member CellLeave

DataGridViewCellEventHandler Fired when a cell loses input focus and is no longer the current cell.

Instance member CellMouseClick

DataGridViewCellMouseEventHandler Occurs whenever the user clicks anywhere on a cell with the mouse.

Instance member CellMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a cell within the DataGridView is double-clicked.

Instance member CellMouseDown

DataGridViewCellMouseEventHandler Fired when the user presses a mouse button while the pointer is within the boundaries of a cell.

Instance member CellMouseEnter

DataGridViewCellEventHandler Fired when the mouse pointer enters a cell.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member CellMouseLeave

DataGridViewCellEventHandler Fired when the mouse pointer leaves a cell.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member CellMouseMove

DataGridViewCellMouseEventHandler Fired when the mouse pointer moves over the DataGridView control.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member CellMouseUp

DataGridViewCellMouseEventHandler Fired when the user releases a mouse button while over a cell.

Instance member CellPaint

DataGridViewCellPaintEventHandler Fired when a cell with the property UserPaint set to true needs to be drawn.

Instance member CellParsing

DataGridViewCellParsingEventHandler Fired when a cell leaves edit mode if the cell value has been modified.

Instance member CellStateChanged

DataGridViewCellStateChangedEventHandler Fired when a cell state changes, such as when the cell is selected or focused.

Instance member CellStyleChanged

DataGridViewCellEventHandler Fired when the Style property of a DataGridViewCell changes.

Instance member CellStyleContentChanged

DataGridViewCellStyleContentChangedEventHandler Fired when one of the values of a cell style changes.

Instance member CellToolClick

DataGridViewToolClickEventHandler Fired when a ComponentTool hosted in a cell editor is clicked.

Instance member CellToolTipTextChanged

DataGridViewCellEventHandler Fired when the value of the ToolTipText property of a cell changes.

Instance member CellToolTipTextNeeded

DataGridViewCellToolTipTextNeededEventHandler Fired when a cell's ToolTip text is needed.

Instance member CellValidated

DataGridViewCellEventHandler Occurs after the cell has finished validating.

Instance member CellValidating

DataGridViewCellValidatingEventHandler Fired when a cell loses input focus, enabling content validation.

Instance member CellValueChanged

DataGridViewCellEventHandler Fired when the value of a cell changes.

Instance member CellValueNeeded

DataGridViewCellValueEventHandler Fired when the VirtualMode property of the DataGridView control is true and the DataGridView requires a value for a cell in order to format and display the cell.

Instance member CellValuePushed

DataGridViewCellValueEventHandler Fired when the VirtualMode property of the DataGridView control is true and a cell value has changed and requires storage in the underlying data source.

Instance member ColumnAdded

DataGridViewColumnEventHandler Fired when a column is added to the control.

Instance member ColumnDisplayIndexChanged

DataGridViewColumnEventHandler Fired when the value the DisplayIndex property for a column changes.

Instance member ColumnFillWeightChanged

DataGridViewColumnEventHandler Fired when the FillWeight property changes.

Instance member ColumnHeaderMouseClick

DataGridViewCellMouseEventHandler Fired when the user clicks a column header.

Instance member ColumnHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a column header is double-clicked.

Instance member ColumnHeadersHeightChanged

EventHandler Fired when the value of the ColumnHeadersHeight property changes.

Instance member ColumnMaximumWidthChanged

DataGridViewColumnEventHandler Fired when the value of the MaximumWidth property for a column changes.

Instance member ColumnMinimumWidthChanged

DataGridViewColumnEventHandler Fired when the value of the MinimumWidth property for a column changes.

Instance member ColumnNameChanged

DataGridViewColumnEventHandler Fired when the Name property changes.

Instance member ColumnRemoved

DataGridViewColumnEventHandler Fired when a column is removed from the control.

Instance member ColumnSortModeChanged

DataGridViewColumnEventHandler Fired when the value of the SortMode property changes.

Instance member ColumnStateChanged

DataGridViewColumnStateChangedEventHandler Fired when a column changes state, such as becoming visible.

Instance member ColumnWidthChanged

DataGridViewColumnEventHandler Fired when the value of the Width property for a column changes.

Instance member CurrentCellChanged

EventHandler Fired when the CurrentCell property changes.

Instance member DataBindingComplete

DataGridViewBindingCompleteEventHandler Occurs after a data-binding operation has finished.

Instance member DataError

DataGridViewDataErrorEventHandler Fired when a data parsing or data validation operation throws an exception, or when committing data to a data source fails.

Instance member DataMemberChanged

EventHandler Fired when value of the DataMember property changes.

Instance member DataRead

DataGridViewDataReadEventHandler Occurs when the client requests a set of rows from the server.

You can use this event when the DataGridView is in VirtualMode to pre-populate a paged data set used when handling the CellValueNeeded events.

Instance member DataSourceChanged

EventHandler Fired when the value of the DataSource property changes.

Instance member DataUpdated

DataGridViewDataUpdatedEventHandler Fired when the client has updated one or more rows in the grid.

This event is fired only if the application has attached at least one handler to the event. Otherwise, simply overriding OnDataUpdated won't work.

Instance member DefaultRowHeightChanged

EventHandler Fired when the value of the DefaultRowHeight property changes.

Instance member DefaultValuesNeeded

DataGridViewRowEventHandler Fired when the user enters the row for new records so that it can be populated with default values.

Instance member EditingControlShowing

DataGridViewEditingControlShowingEventHandler Fired when a control for editing a cell is showing.

Instance member EditModeChanged

EventHandler Fired when the value of the EditMode property changes.

Instance member KeepSameRowHeightChanged

EventHandler Fired when the value of the KeepSameRowHeight property changes.

Instance member LastCellTab

DataGridViewCellEventHandler Fired when the user tabs past the last cell.

Instance member LiveResizeChanged

EventHandler Fired when the value of the LiveResize property changes.

Instance member MultiSelectChanged

EventHandler Fired when the value of the MultiSelect property changes.

Instance member NewRowNeeded

DataGridViewRowEventHandler Fired when the VirtualMode property of the DataGridView is true and the user navigates to the new row at the bottom of the DataGridView.

Instance member ReadOnlyChanged

EventHandler Fired when the value of the ReadOnly property changes.

Instance member RowCollapsed

DataGridViewRowEventHandler Fired when a parent row is collapsed.

Instance member RowEnter

DataGridViewCellEventHandler Fired when a row receives input focus but before it becomes the current row.

Instance member RowErrorTextChanged

DataGridViewRowEventHandler Fired when the ErrorText property of a row changes.

Instance member RowErrorTextNeeded

DataGridViewRowErrorTextNeededEventHandler Fired when the row's error text is required.

Instance member RowExpanded

DataGridViewRowEventHandler Fired when a parent row is expanded.

Instance member RowHeaderMouseClick

DataGridViewCellMouseEventHandler Fired when the user clicks within the boundaries of a row header.

Instance member RowHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a row header is double-clicked.

Instance member RowHeadersWidthChanged

EventHandler Fired when value of the RowHeadersWidth property changes.

Instance member RowHeightChanged

DataGridViewRowEventHandler Fired when the value of the Height property for a row changes.

Instance member RowHeightInfoNeeded

DataGridViewRowHeightInfoNeededEventHandler Fired when information about row height is requested.

Instance member RowLeave

DataGridViewCellEventHandler Fired when a row loses input focus and is no longer the current row.

Instance member RowMaximumHeightChanged

DataGridViewRowEventHandler Fired when the value of the MaximumHeight property for a row changes.

Instance member RowMinimumHeightChanged

DataGridViewRowEventHandler Fired when the value of the MinimumHeight property for a row changes.

Instance member RowsAdded

DataGridViewRowsAddedEventHandler Occurs after a new row is added to the DataGridView.

Instance member RowsRemoved

DataGridViewRowsRemovedEventHandler Fired when a row or rows are deleted from the DataGridView.

Instance member RowStateChanged

DataGridViewRowStateChangedEventHandler Fired when a row changes state, such as getting selected.

Instance member RowValidated

DataGridViewCellEventHandler Occurs after a row has finished validating.

Instance member RowValidating

DataGridViewCellCancelEventHandler Fired when a row is validating.

Instance member Scroll

ScrollEventHandler Fired when the user or code scrolls the grid.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member SelectionChanged

EventHandler Fired when the current selection changes.

Instance member ShowColumnVisibilityMenuChanged

EventHandler Fired when the value of the ShowColumnVisibilityMenu property changes.

Instance member SortCompare

DataGridViewSortCompareEventHandler Fired when the DataGridView compares two cell values to perform a sort operation.

Instance member Sorted

EventHandler Fired when the DataGridView control completes a sorting operation.

Instance member StandardReturnChanged

EventHandler Fired when the value of the StandardReturn property changes.

Instance member StandardTabChanged

EventHandler Fired when the value of the StandardTab property changes.

Instance member ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Instance member TopLeftHeaderClick

DataGridViewCellCancelEventHandler Fired when the user presses a mouse button while the pointer is on the top-left corner cell.

Instance member UserAddedRow

DataGridViewRowEventHandler Fired when the user has finished adding a row to the DataGridView control.

Instance member UserDeletedRow

DataGridViewRowEventHandler Fired when the user has finished deleting a row from the DataGridView control.

Instance member UserDeletingRow

DataGridViewRowCancelEventHandler Fired when the user deletes a row from the DataGridView control.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IReadOnlyProvides access to the ReadOnly property for coontrols that support the read-only mode.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejDataStoreAll wisej data stores implement this interface.
IWisejHandlerRepresents a Wisej component that is capable of handling postback requests from the client.
IWisejSerializableAllows an object to serialize itself.