Skip to main content
Version: 3.5

DataGridView

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents a data grid control.

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

Constructors

Instance memberDataGridView()

Initializes a new instance of the DataGridView class.

Instance memberDataGridView(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 memberDataGridView(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 memberAllowSortingDataSource

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 memberAllowUserToAddRows

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

Instance memberAllowUserToDeleteRows

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

Instance memberAllowUserToOrderColumns

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

Instance memberAllowUserToResizeColumns

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

Instance memberAllowUserToResizeRows

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

Instance memberAutoGenerateColumns

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 memberAutoGenerateColumnsDefault

Boolean: EXPERIMENTAL: 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 memberAutoSelectFirstRow

Boolean: EXPERIMENTAL: 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 memberAutoSelectFirstRowDefault

Boolean: EXPERIMENTAL: 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 memberAutoSize

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

Instance memberAutoSizeColumnsMode

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

Instance memberAutoSizeRowsMode

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

Throws:

Instance memberBlockSize

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 memberBorderStyle

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

Instance memberCellBorderStyle

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

Instance memberClipboardCopyMode

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 memberColumnCount

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

Throws:

Instance memberColumnHeadersBorderStyle

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

Instance memberColumnHeadersDefaultCellStyle

DataGridViewCellStyle: Returns or sets the default column header style.

Instance memberColumnHeadersHeight

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 memberColumnHeadersHeightSizeMode

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 memberColumnHeadersVisible

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

Throws:

Instance memberColumns

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

Instance memberCurrentCell

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 memberCurrentCellAddress

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

Instance memberCurrentRow

DataGridViewRow: Returns the row containing the current cell.

Instance memberDataMember

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 memberDataSource

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

Throws:

Instance memberDefaultCellStyle

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 memberDefaultRowHeight

Int32: Returns or sets the default row height.

Instance memberDefaultSortMode

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

Instance memberEditingControl

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

Instance memberEditMode

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 memberFirstDisplayedCell

DataGridViewCell: Returns the first cell currently displayed in the DataGridView in the upper left corner.

Instance memberFirstDisplayedColumnIndex

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

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 memberFirstDisplayedRowIndex

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

Throws:

  • ArgumentOutOfRangeException The specified value when setting this property is less than 0 or greater than the number of rows in the control minus 1.
  • InvalidOperationException The specified value when setting this property indicates a row 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 memberHorizontalScrollingOffset

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

Instance memberHScroll

Boolean: Returns whether the horizontal scroll bar is visible.

Instance memberIndent

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

Throws:

Instance memberIsCurrentCellDirty

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

Instance memberIsCurrentCellInEditMode

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

Instance memberIsCurrentRowDirty

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

Instance memberItem(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 memberItem(columnName, rowIndex)

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

Instance memberItem(column, rowIndex)

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

Instance memberItem(cellAddress)

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

Instance memberKeepSameRowHeight

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

Instance memberLiveResize

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 memberMaxCachedBlocks

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 memberMultiSelect

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 memberNewRowIndex

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

Instance memberNoDataMessage

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

Instance memberReadOnly

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 memberRightClickSelection

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 memberRowCount

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

Throws:

Instance memberRowHeaderColumn

DataGridViewColumn: Returns the DataGridViewColumn for the row headers.

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

Instance memberRowHeadersDefaultCellStyle

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

Instance memberRowHeadersMaximumWidth

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 memberRowHeadersMinimumWidth

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 memberRowHeadersVisible

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

Instance memberRowHeadersWidth

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 memberRowHeadersWidthSizeMode

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 memberRows

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

Instance memberRowTemplate

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

Throws:

Instance memberScrollBars

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

Instance memberSelectedCells

DataGridViewSelectedCellCollection: Returns the collection of selected cells.

Instance memberSelectedColumns

DataGridViewSelectedColumnCollection: Returns the collection of selected columns.

Instance memberSelectedRows

DataGridViewSelectedRowCollection: Returns the collection of selected rows.

Instance memberSelectionDelay

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 memberSelectionMode

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

Instance memberShowCellErrors

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

Instance memberShowCellToolTips

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

Instance memberShowColumnVisibilityMenu

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

Instance memberShowFocusCell

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

Instance memberShowRowErrors

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

Instance memberSortedColumn

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

Instance memberSortFrozenRows

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

Instance memberSortOrder

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

Instance memberSortSelectionMode

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 memberStandardReturn

Boolean: EXPERIMENTAL: 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 memberStandardTab

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 memberTools

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

Instance memberToolsPosition

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

Instance memberTopLeftHeaderCell

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

Instance memberTreeColumn

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 memberVirtualMode

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

Instance memberVisibleRowCount

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

Instance memberVScroll

Boolean: Returns whether the vertical scroll bar is visible.

Methods

Instance memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAddSummaryRows(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 memberAppend(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 memberAreAllCellsSelected(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 memberAutoResizeColumn(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 memberAutoResizeColumn(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 memberAutoResizeColumn(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 memberAutoResizeColumn(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 memberAutoResizeColumnHeadersHeight()

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

Instance memberAutoResizeColumnHeadersHeight(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 memberAutoResizeColumns()

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

Instance memberAutoResizeColumns(extraSpace)

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

ParameterTypeDescription
extraSpaceInt32Additional space in pixels.

Instance memberAutoResizeColumns(autoSizeMode)

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

ParameterTypeDescription
autoSizeModeDataGridViewAutoSizeColumnsModeOne of the DataGridViewAutoSizeColumnsMode values.

Throws:

Instance memberAutoResizeColumns(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 memberAutoResizeRow(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 memberAutoResizeRow(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 memberAutoResizeRow(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 memberAutoResizeRow(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 memberAutoResizeRowHeadersWidth(autoSizeMode)

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

ParameterTypeDescription
autoSizeModeDataGridViewRowHeadersWidthSizeModeOne of the DataGridViewRowHeadersWidthSizeMode values.

Throws:

Instance memberAutoResizeRowHeadersWidth(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 memberAutoResizeRowHeadersWidth(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 memberAutoResizeRowHeadersWidth(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 memberAutoResizeRows()

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 memberAutoResizeRows(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 memberAutoResizeRows(autoSizeMode)

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

ParameterTypeDescription
autoSizeModeDataGridViewAutoSizeRowsModeOne of the DataGridViewAutoSizeRowMode values.

Throws:

Instance memberBeginEdit(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 memberBeginUpdate()

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

Instance memberCancelEdit()

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

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

Instance memberCanSort(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 memberClearSelection()

Clears the current selection.

Instance memberCommitEdit()

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 memberCreateSummaryRow(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.

Instance memberEndEdit()

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 memberEndUpdate()

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

Instance memberFill(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 memberGetClipboardContent()

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 memberGetCommand(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 memberGetCommand(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 memberGetCommand(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 memberGetCommand(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 memberGetFormattedValue(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 memberGetFormattedValue(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 memberGetFormattedValue(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 memberGetRowState(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 memberGetValue(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 memberGetValue(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 memberGetValue(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 memberGetValue(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 memberHitTest(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 memberHitTest(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 memberIsCellEditable(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 memberIsCellEditable(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 memberIsCellEditable(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 memberIsCellVisible(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 memberIsCellVisible(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 memberIsCellVisible(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 memberIsValidCell(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 memberIsValidCell(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 memberIsValidColumn(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 memberIsValidRow(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 memberNotifyCurrentCellDirty(dirty)

Notifies the DataGridView that the current cell has uncommitted changes.

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

Instance memberOnTopLeftHeaderClick(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:

Instance memberRefresh()

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

Instance memberRefresh(refreshChildren)

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

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

Instance memberRemoveSummaryRows(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 memberRemoveSummaryRows()

Removes the all the summary rows.

Instance memberRemoveSummaryRows(summaryPosition)

Removes the summary rows that match the specified summaryPosition .

ParameterTypeDescription
summaryPositionSummaryRowPositionPosition of the summary rows to remove.

Instance memberRemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

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

Instance memberRemoveSummaryRows(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 memberRemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

ParameterTypeDescription
groupFromColDataGridViewColumnFirst column that determines the group break values.

Instance memberRemoveSummaryRows(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 memberRemoveSummaryRows(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 memberRemoveSummaryRows(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 memberScrollCellIntoView(cell)

Scrolls the specified cell into view.

ParameterTypeDescription
cellDataGridViewCellThe DataGridViewCell to scroll into view.

Throws:

Instance memberScrollCellIntoView(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 memberScrollCellIntoView(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 memberScrollCellIntoView(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 memberScrollCellIntoView(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 memberScrollCellIntoView(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 memberScrollColumnIntoView(columnIndex)

Scrolls the specified column into view.

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

Throws:

Instance memberScrollColumnIntoView(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 memberScrollColumnIntoView(column)

Scrolls the specified column into view.

ParameterTypeDescription
columnDataGridViewColumnThe DataGridViewColumnto scroll into view.

Throws:

Instance memberScrollColumnIntoView(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 memberScrollRowIntoView(rowIndex)

Scrolls the specified row into view.

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

Throws:

Instance memberScrollRowIntoView(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 memberScrollRowIntoView(row)

Scrolls the specified row into view.

ParameterTypeDescription
rowDataGridViewRowThe DataGridViewRowto scroll into view.

Throws:

Instance memberScrollRowIntoView(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 memberSelectAll()

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

Instance memberSelectAllCells()

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

Instance memberSelectAllColumns()

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

Instance memberSelectAllRows()

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

Instance memberSetCommand(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 memberSetCommand(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 memberSetCommand(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 memberSetCommand(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 memberSetCurrentCell(cellAddress)

Sets the currently focused cell.

ParameterTypeDescription
cellAddressPointAddress of the cell.

Instance memberSetCurrentCell(columnIndex, rowIndex)

Sets the currently focused cell.

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

Instance memberSetRowState(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 memberSetRowState(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 memberSetValue(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 memberSetValue(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 memberSetValue(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 memberSetValue(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 memberSort(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 memberSort(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 memberUpdate()

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 memberAllowUserToAddRowsChanged

EventHandler Fired when the value of the AllowUserToAddRows property changes.

Instance memberAllowUserToDeleteRowsChanged

EventHandler Fired when the value of the AllowUserToDeleteRowsChanged property changes.

Instance memberAllowUserToOrderColumnsChanged

EventHandler Fired when the value of the AllowUserToOrderColumns property changes.

Instance memberAllowUserToResizeColumnsChanged

EventHandler Fired when the value of the AllowUserToResizeColumns property changes.

Instance memberAllowUserToResizeRowsChanged

EventHandler Fired when the value of the AllowUserToResizeRows property changes.

Instance memberCellBeginEdit

DataGridViewCellCancelEventHandler Fired when edit mode starts for the selected cell.

Instance memberCellClick

DataGridViewCellEventHandler Fired when any part of a cell is clicked.

Instance memberCellCommandChanged

DataGridViewCellEventHandler Fired when the command of a cell changes.

Instance memberCellCommandNeeded

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 memberCellCommandPushed

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 memberCellContextMenuNeeded

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

Instance memberCellDoubleClick

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

Instance memberCellEndEdit

DataGridViewCellEventHandler Fired when edit mode stops for the current cell.

Instance memberCellEnter

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

Instance memberCellErrorTextChanged

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

Instance memberCellErrorTextNeeded

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

Instance memberCellFormatting

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

Instance memberCellLeave

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

Instance memberCellMouseClick

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

Instance memberCellMouseDoubleClick

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

Instance memberCellMouseDown

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

Instance memberCellMouseEnter

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 memberCellMouseLeave

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 memberCellMouseMove

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 memberCellMouseUp

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

Instance memberCellPaint

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

Instance memberCellParsing

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

Instance memberCellStateChanged

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

Instance memberCellStyleChanged

DataGridViewCellEventHandler Fired when the Style property of a DataGridViewCell changes.

Instance memberCellStyleContentChanged

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

Instance memberCellToolClick

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

Instance memberCellToolTipTextChanged

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

Instance memberCellToolTipTextNeeded

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

Instance memberCellValidated

DataGridViewCellEventHandler Occurs after the cell has finished validating.

Instance memberCellValidating

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

Instance memberCellValueChanged

DataGridViewCellEventHandler Fired when the value of a cell changes.

Instance memberCellValueNeeded

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 memberCellValuePushed

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 memberColumnAdded

DataGridViewColumnEventHandler Fired when a column is added to the control.

Instance memberColumnDisplayIndexChanged

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

Instance memberColumnFillWeightChanged

DataGridViewColumnEventHandler Fired when the FillWeight property changes.

Instance memberColumnHeaderMouseClick

DataGridViewCellMouseEventHandler Fired when the user clicks a column header.

Instance memberColumnHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a column header is double-clicked.

Instance memberColumnHeadersHeightChanged

EventHandler Fired when the value of the ColumnHeadersHeight property changes.

Instance memberColumnMaximumWidthChanged

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

Instance memberColumnMinimumWidthChanged

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

Instance memberColumnNameChanged

DataGridViewColumnEventHandler Fired when the Name property changes.

Instance memberColumnRemoved

DataGridViewColumnEventHandler Fired when a column is removed from the control.

Instance memberColumnSortModeChanged

DataGridViewColumnEventHandler Fired when the value of the SortMode property changes.

Instance memberColumnStateChanged

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

Instance memberColumnWidthChanged

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

Instance memberCurrentCellChanged

EventHandler Fired when the CurrentCell property changes.

Instance memberDataBindingComplete

DataGridViewBindingCompleteEventHandler Occurs after a data-binding operation has finished.

Instance memberDataError

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

Instance memberDataMemberChanged

EventHandler Fired when value of the DataMember property changes.

Instance memberDataRead

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 memberDataSourceChanged

EventHandler Fired when the value of the DataSource property changes.

Instance memberDataUpdated

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 memberDefaultRowHeightChanged

EventHandler Fired when the value of the DefaultRowHeight property changes.

Instance memberDefaultValuesNeeded

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

Instance memberEditingControlShowing

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

Instance memberEditModeChanged

EventHandler Fired when the value of the EditMode property changes.

Instance memberKeepSameRowHeightChanged

EventHandler Fired when the value of the KeepSameRowHeight property changes.

Instance memberLastCellTab

DataGridViewCellEventHandler Fired when the user tabs past the last cell.

Instance memberLiveResizeChanged

EventHandler Fired when the value of the LiveResize property changes.

Instance memberMultiSelectChanged

EventHandler Fired when the value of the MultiSelect property changes.

Instance memberNewRowNeeded

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 memberReadOnlyChanged

EventHandler Fired when the value of the ReadOnly property changes.

Instance memberRowCollapsed

DataGridViewRowEventHandler Fired when a parent row is collapsed.

Instance memberRowEnter

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

Instance memberRowErrorTextChanged

DataGridViewRowEventHandler Fired when the ErrorText property of a row changes.

Instance memberRowErrorTextNeeded

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

Instance memberRowExpanded

DataGridViewRowEventHandler Fired when a parent row is expanded.

Instance memberRowHeaderMouseClick

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

Instance memberRowHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a row header is double-clicked.

Instance memberRowHeadersWidthChanged

EventHandler Fired when value of the RowHeadersWidth property changes.

Instance memberRowHeightChanged

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

Instance memberRowHeightInfoNeeded

DataGridViewRowHeightInfoNeededEventHandler Fired when information about row height is requested.

Instance memberRowLeave

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

Instance memberRowMaximumHeightChanged

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

Instance memberRowMinimumHeightChanged

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

Instance memberRowsAdded

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

Instance memberRowsRemoved

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

Instance memberRowStateChanged

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

Instance memberRowValidated

DataGridViewCellEventHandler Occurs after a row has finished validating.

Instance memberRowValidating

DataGridViewCellCancelEventHandler Fired when a row is validating.

Instance memberScroll

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 memberSelectionChanged

EventHandler Fired when the current selection changes.

Instance memberShowColumnVisibilityMenuChanged

EventHandler Fired when the value of the ShowColumnVisibilityMenu property changes.

Instance memberSortCompare

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

Instance memberSorted

EventHandler Fired when the DataGridView control completes a sorting operation.

Instance memberStandardReturnChanged

EventHandler Fired when the value of the StandardReturn property changes.

Instance memberStandardTabChanged

EventHandler Fired when the value of the StandardTab property changes.

Instance memberToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Instance memberTopLeftHeaderClick

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

Instance memberUserAddedRow

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

Instance memberUserDeletedRow

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

Instance memberUserDeletingRow

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

Implements

NameDescription
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.