DataGridView

Wisej.Web.DataGridView

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.2.0.0)

Represents a data grid control.

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

Constructors

DataGridView()

Initializes a new instance of the DataGridView class.

Properties

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.

AllowUserToAddRows

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

AllowUserToDeleteRows

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

AllowUserToOrderColumns

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

AllowUserToResizeColumns

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

AllowUserToResizeRows

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

AutoGenerateColumns

Boolean: Returns or sets whether columns are created automatically when the DataSource or DataMember properties are set. This property is ignored in design mode - auto column generation is always on. (Default: True)

AutoSize

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

AutoSizeColumnsMode

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

AutoSizeRowsMode

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

Throws:

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.

BorderStyle

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

CellBorderStyle

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

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)

ColumnCount

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

Throws:

ColumnHeadersBorderStyle

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

ColumnHeadersDefaultCellStyle

DataGridViewCellStyle: Returns or sets the default column header style.

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.

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)

ColumnHeadersVisible

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

Throws:

Columns

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

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.

CurrentCellAddress

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

CurrentRow

DataGridViewRow: Returns the row containing the current cell.

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:

DataSource

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

Throws:

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.

DefaultRowHeight

Int32: Returns or sets the default row height.

DefaultSortMode

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

EditingControl

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

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.

FirstDisplayedCell

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

FirstDisplayedColumnIndex

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.

FirstDisplayedRowIndex

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.

HorizontalScrollingOffset

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

HScroll

Boolean: Returns whether the horizontal scroll bar is visible.

Indent

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

Throws:

IsCurrentCellDirty

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

IsCurrentCellInEditMode

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

IsCurrentRowDirty

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

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.

Item(columnName, rowIndex)

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

Item(column, rowIndex)

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

Item(cellAddress)

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

KeepSameRowHeight

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

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)

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.

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)

NewRowIndex

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

NoDataMessage

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

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.

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.

RowCount

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

Throws:

RowHeaderColumn

DataGridViewColumn: Returns the DataGridViewColumn for the row headers.

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

RowHeadersDefaultCellStyle

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

RowHeadersMaximumWidth

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

Throws:

RowHeadersMinimumWidth

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

Throws:

RowHeadersVisible

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

RowHeadersWidth

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

Throws:

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)

Rows

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

RowTemplate

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

Throws:

ScrollBars

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

SelectedCells

DataGridViewSelectedCellCollection: Returns the collection of selected cells.

SelectedColumns

DataGridViewSelectedColumnCollection: Returns the collection of selected columns.

SelectedRows

DataGridViewSelectedRowCollection: Returns the collection of selected rows.

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:

SelectionMode

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

ShowCellErrors

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

ShowCellToolTips

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

ShowColumnVisibilityMenu

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

ShowFocusCell

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

ShowRowErrors

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

SortedColumn

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

SortFrozenRows

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

SortOrder

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

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.

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)

Tools

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

ToolsPosition

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

TopLeftHeaderCell

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

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.

VirtualMode

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

VisibleRowCount

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

VScroll

Boolean: Returns whether the vertical scroll bar is visible.

Methods

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

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

Parameter
Type
Description

summaryType

Determines the aggregation type.

groupCol

Name of the column that determines the group break values.

summaryCol

name of the column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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

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

Parameter
Type
Description

summaryType

Determines the aggregation type.

summaryPosition

Indicates the position of the DataGridViewSummaryRow.

groupCol

Name of the column that determines the group break values.

summaryCol

Name of the column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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 .

Parameter
Type
Description

summaryType

Determines the aggregation type.

groupFromCol

Name of the first column that determines the group break values.

groupToCol

Name of the last column that determines the group break values.

summaryCol

Name of the column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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 .

Parameter
Type
Description

summaryType

Determines the aggregation type.

summaryPosition

Indicates the position of the DataGridViewSummaryRow.

groupFromCol

Name of the first column that determines the group break values.

groupToCol

Name of the last column that determines the group break values.

summaryCol

Name of the column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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

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

Parameter
Type
Description

summaryType

Determines the aggregation type.

groupCol

Column that determines the group break values.

summaryCol

Column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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

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

Parameter
Type
Description

summaryType

Determines the aggregation type.

summaryPosition

Indicates the position of the DataGridViewSummaryRow.

groupCol

Column that determines the group break values.

summaryCol

Column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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 .

Parameter
Type
Description

summaryType

Determines the aggregation type.

groupFromCol

First column that determines the group break values.

groupToCol

Last column that determines the group break values.

summaryCol

Column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

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 .

Parameter
Type
Description

summaryType

Determines the aggregation type.

summaryPosition

Indicates the position of the DataGridViewSummaryRow.

groupFromCol

First column that determines the group break values.

groupToCol

Last column that determines the group break values.

summaryCol

Column to aggregate.

style

Optional DataGridViewCellStyle for the summary rows.

customSummary

Optional custom summary function, used when summaryType is Custom.

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

Append(data, dataMember)

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

Parameter
Type
Description

data

The object that contains data for the DataGridView to display.

dataMember

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

AreAllCellsSelected(includeInvisibleCells)

Returns whether all the cells are currently selected.

Parameter
Type
Description

includeInvisibleCells

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

AutoResizeColumn(columnIndex)

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

Parameter
Type
Description

columnIndex

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

Throws:

AutoResizeColumn(columnIndex, extraSpace)

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

Parameter
Type
Description

columnIndex

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

extraSpace

Additional space in pixels.

Throws:

AutoResizeColumn(columnIndex, autoSizeMode)

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

Parameter
Type
Description

columnIndex

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

Throws:

AutoResizeColumn(columnIndex, autoSizeMode, extraSpace)

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

Parameter
Type
Description

columnIndex

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

extraSpace

Additional space in pixels.

Throws:

AutoResizeColumnHeadersHeight()

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

AutoResizeColumnHeadersHeight(columnIndex)

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

Parameter
Type
Description

columnIndex

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

Throws:

AutoResizeColumns()

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

AutoResizeColumns(extraSpace)

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

Parameter
Type
Description

extraSpace

Additional space in pixels.

AutoResizeColumns(autoSizeMode)

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

Parameter
Type
Description

Throws:

AutoResizeColumns(autoSizeMode, extraSpace)

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

Parameter
Type
Description

extraSpace

Additional space in pixels.

Throws:

AutoResizeRow(rowIndex)

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

Parameter
Type
Description

rowIndex

The index of the row to resize.

Throws:

AutoResizeRow(rowIndex, extraSpace)

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

Parameter
Type
Description

rowIndex

The index of the row to resize.

extraSpace

Additional space in pixels.

Throws:

AutoResizeRow(rowIndex, autoSizeMode)

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

Parameter
Type
Description

rowIndex

The index of the row to resize.

Throws:

AutoResizeRow(rowIndex, autoSizeMode, extraSpace)

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

Parameter
Type
Description

rowIndex

The index of the row to resize.

extraSpace

Additional space in pixels.

Throws:

AutoResizeRowHeadersWidth(autoSizeMode)

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

Parameter
Type
Description

Throws:

AutoResizeRowHeadersWidth(autoSizeMode, extraSpace)

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

Parameter
Type
Description

extraSpace

Additional space in pixels.

Throws:

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.

Parameter
Type
Description

rowIndex

The index of the row header with the changed content.

Throws:

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.

Parameter
Type
Description

rowIndex

The index of the row header with the changed content.

extraSpace

Additional space in pixels.

Throws:

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.

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.

Parameter
Type
Description

extraSpace

Additional space in pixels.

AutoResizeRows(autoSizeMode)

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

Parameter
Type
Description

Throws:

BeginEdit(selectAll)

Puts the current cell in edit mode.

Parameter
Type
Description

selectAll

true 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:

BeginUpdate()

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

CancelEdit()

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

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

ClearSelection()

Clears the current selection.

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.

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.

EndUpdate()

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

Fill(data, dataMember)

Populates the DataGridView from the data .

Parameter
Type
Description

data

The object that contains data for the DataGridView to display.

dataMember

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

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:

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.

Parameter
Type
Description

columnIndex

The index of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

cellAddress

Row and column index of the cell.

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

Throws:

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.

Parameter
Type
Description

column

The DataGridViewColumn that contains the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

columnName

The Name of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

columnIndex

The index of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

column

The DataGridViewColumn that contains the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

columnName

The Name of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

GetRowState(rowIndex)

Returns the state of the DataGridViewRow at the specified index.

Parameter
Type
Description

rowIndex

The index of the row.

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

Throws:

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.

Parameter
Type
Description

columnIndex

The index of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

cellAddress

Row and column index of the cell.

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

Throws:

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.

Parameter
Type
Description

column

The DataGridViewColumn that contains the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

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.

Parameter
Type
Description

columnName

The Name of the column containing the cell.

rowIndex

The index of the row containing the cell.

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

Throws:

HitTest(x, y)

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

Parameter
Type
Description

x

The x coordinate relative to the DataGridView control.

y

The y coordinate relative to the DataGridView control.

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

HitTest(position)

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

Parameter
Type
Description

position

The x, y coordinate relative to the DataGridView control.

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

IsCellEditable(cell)

Checks if the specified cell can enter edit mode.

Parameter
Type
Description

cell

Cell to verify.

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

IsCellEditable(colIndex, rowIndex)

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

Parameter
Type
Description

colIndex

The column index of the cell to verify.

rowIndex

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

IsCellEditable(cellAddress)

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

Parameter
Type
Description

cellAddress

Coordinates of the cell to verify.

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

IsCellVisible(cell)

Checks if the specified cell is visible.

Parameter
Type
Description

cell

Cell to verify.

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

IsCellVisible(colIndex, rowIndex)

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

Parameter
Type
Description

colIndex

The column index of the cell to verify.

rowIndex

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

IsCellVisible(cellAddress)

Checks if the cell at the cellAddress location is visible.

Parameter
Type
Description

cellAddress

Coordinates of the cell to verify.

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

IsValidCell(cellAddress)

Verifies that the cell address refers to a valid cell.

Parameter
Type
Description

cellAddress

Cell address to verify.

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

IsValidCell(colIndex, rowIndex)

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

Parameter
Type
Description

colIndex

The index of the column to verify.

rowIndex

The index of the row to verify.

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

IsValidColumn(colIndex)

Verifies that the column index refer to a valid column.

Parameter
Type
Description

colIndex

The index of the column to verify.

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

IsValidRow(rowIndex)

Verifies that the row index refer to a valid row.

Parameter
Type
Description

rowIndex

The index of the row to verify.

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

NotifyCurrentCellDirty(dirty)

Notifies the DataGridView that the current cell has uncommitted changes.

Parameter
Type
Description

dirty

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

OnTopLeftHeaderClick(e)

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

Parameter
Type
Description

Throws:

Refresh()

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

Refresh(refreshChildren)

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

Parameter
Type
Description

refreshChildren

True to also refresh all the children of this control.

RemoveSummaryRows()

Removes the all the summary rows.

RemoveSummaryRows(summaryPosition)

Removes the summary rows that match the specified summaryPosition .

Parameter
Type
Description

summaryPosition

Position of the summary rows to remove.

RemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

Parameter
Type
Description

groupFromCol

Name of the first column that determines the group break values.

RemoveSummaryRows(groupFromCol, groupToCol)

Removes the summary rows grouped by groupFromCol and groupToCol .

Parameter
Type
Description

groupFromCol

Name of the first column that determines the group break values.

groupToCol

Name of the last column that determines the group break values.

RemoveSummaryRows(groupFromCol)

Removes the summary rows grouped by groupFromCol .

Parameter
Type
Description

groupFromCol

First column that determines the group break values.

RemoveSummaryRows(groupFromCol, groupToCol)

Removes the summary rows grouped by groupFromCol and groupToCol .

Parameter
Type
Description

groupFromCol

First column that determines the group break values.

groupToCol

Last column that determines the group break values.

RemoveSummaryRows(summaryPosition, groupFromCol)

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

Parameter
Type
Description

summaryPosition

Position of the summary rows to remove.

groupFromCol

Name of the first column that determines the group break values.

RemoveSummaryRows(summaryPosition, groupFromCol, groupToCol)

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

Parameter
Type
Description

summaryPosition

Position of the summary rows to remove.

groupFromCol

Name of the first column that determines the group break values.

groupToCol

Name of the last column that determines the group break values.

RemoveSummaryRows(summaryPosition, groupFromCol, groupToCol)

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

Parameter
Type
Description

summaryPosition

Position of the summary rows to remove.

groupFromCol

First column that determines the group break values.

groupToCol

Last column that determines the group break values.

ScrollCellIntoView(cell)

Scrolls the specified cell into view.

Parameter
Type
Description

cell

The DataGridViewCell to scroll into view.

Throws:

ScrollCellIntoView(cell, alignX, alignY)

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

Parameter
Type
Description

cell

The DataGridViewCell to scroll into view.

alignX

One of Left or Right. Any other value is ignored and will use the least-effort alignment.

alignY

One of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

ScrollCellIntoView(cellAddress)

Scrolls the specified cell into view.

Parameter
Type
Description

cellAddress

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

ScrollCellIntoView(cellAddress, alignX, alignY)

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

Parameter
Type
Description

cellAddress

The address of the cell to scroll into view.

alignX

One of Left or Right. Any other value is ignored and will use the least-effort alignment.

alignY

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

ScrollCellIntoView(columnIndex, rowIndex)

Scrolls the specified cell into view.

Parameter
Type
Description

columnIndex

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

rowIndex

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

ScrollCellIntoView(columnIndex, rowIndex, alignX, alignY)

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

Parameter
Type
Description

columnIndex

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

rowIndex

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

alignX

One of Left or Right. Any other value is ignored and will use the least-effort alignment.

alignY

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

ScrollColumnIntoView(columnIndex)

Scrolls the specified column into view.

Parameter
Type
Description

columnIndex

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

Throws:

ScrollColumnIntoView(columnIndex, alignX)

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

Parameter
Type
Description

columnIndex

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

alignX

One of Left or Right. Any other value is ignored and will use the least-effort alignment.

Throws:

ScrollColumnIntoView(column)

Scrolls the specified column into view.

Parameter
Type
Description

column

The DataGridViewColumnto scroll into view.

Throws:

ScrollColumnIntoView(column, alignX)

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

Parameter
Type
Description

column

The DataGridViewColumnto scroll into view.

alignX

One of Left or Right. Any other value is ignored and will use the least-effort alignment.

Throws:

ScrollRowIntoView(rowIndex)

Scrolls the specified row into view.

Parameter
Type
Description

rowIndex

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

Throws:

ScrollRowIntoView(rowIndex, alignY)

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

Parameter
Type
Description

rowIndex

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

alignY

One of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

ScrollRowIntoView(row)

Scrolls the specified row into view.

Parameter
Type
Description

row

The DataGridViewRowto scroll into view.

Throws:

ScrollRowIntoView(row, alignY)

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

Parameter
Type
Description

row

The DataGridViewRowto scroll into view.

alignY

One of Top or Bottom. Any other value is ignored and will use the least-effort alignment.

Throws:

SelectAll()

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

SelectAllCells()

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

SelectAllColumns()

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

SelectAllRows()

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

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.

Parameter
Type
Description

column

The DataGridViewColumn that contains the cell.

rowIndex

The index of the row containing the cell.

command

Value to store in the cell identified by column and rowIndex .

Throws:

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.

Parameter
Type
Description

columnIndex

The index of the column containing the cell.

rowIndex

The index of the row containing the cell.

command

Value to store in the cell identified by columnIndex and rowIndex .

Throws:

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.

Parameter
Type
Description

cellAddress

Row and column index of the cell.

command

Value to store in the cell identified by cellAddress .

Throws:

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.

Parameter
Type
Description

columnName

The Name of the column containing the cell.

rowIndex

The index of the row containing the cell.

command

Value to store in the cell identified by columnName and rowIndex .

Throws:

SetCurrentCell(cellAddress)

Sets the currently focused cell.

Parameter
Type
Description

cellAddress

Address of the cell.

SetCurrentCell(columnIndex, rowIndex)

Sets the currently focused cell.

Parameter
Type
Description

columnIndex

Column index of the cell.

rowIndex

Row index of the cell.

SetRowState(rowIndex, state)

Sets the state for the row at rowIndex .

Parameter
Type
Description

rowIndex

The index of the row.

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:

SetRowState(rowIndex, state, on)

Sets the state for the row at rowIndex .

Parameter
Type
Description

rowIndex

The index of the row.

on

True to add the state , otherwise false to remove the state .

Throws:

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.

Parameter
Type
Description

columnIndex

The index of the column containing the cell.

rowIndex

The index of the row containing the cell.

value

Value to store in the cell identified by columnIndex and rowIndex .

Throws:

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.

Parameter
Type
Description

cellAddress

Row and column index of the cell.

value

Value to store in the cell identified by cellAddress .

Throws:

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.

Parameter
Type
Description

columnName

The Name of the column containing the cell.

rowIndex

The index of the row containing the cell.

value

Value to store in the cell identified by columnName and rowIndex .

Throws:

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.

Parameter
Type
Description

column

The DataGridViewColumn that contains the cell.

rowIndex

The index of the row containing the cell.

value

Value to store in the cell identified by column and rowIndex .

Throws:

Sort(column, direction)

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

Parameter
Type
Description

column

The column by which to sort the contents of the DataGridView.

direction

One of the ListSortDirection values.

Throws:

Sort(comparer)

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

Parameter
Type
Description

comparer

An implementation of IComparer that performs the custom sorting operation.

Throws:

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

AllowUserToAddRowsChanged

EventHandler Fired when the value of the AllowUserToAddRows property changes.

AllowUserToDeleteRowsChanged

EventHandler Fired when the value of the AllowUserToDeleteRowsChanged property changes.

AllowUserToOrderColumnsChanged

EventHandler Fired when the value of the AllowUserToOrderColumns property changes.

AllowUserToResizeColumnsChanged

EventHandler Fired when the value of the AllowUserToResizeColumns property changes.

AllowUserToResizeRowsChanged

EventHandler Fired when the value of the AllowUserToResizeRows property changes.

CellBeginEdit

DataGridViewCellCancelEventHandler Fired when edit mode starts for the selected cell.

CellClick

DataGridViewCellEventHandler Fired when any part of a cell is clicked.

CellCommandChanged

DataGridViewCellEventHandler Fired when the command of a cell changes.

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.

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.

CellContextMenuNeeded

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

CellDoubleClick

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

CellEndEdit

DataGridViewCellEventHandler Fired when edit mode stops for the current cell.

CellEnter

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

CellErrorTextChanged

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

CellErrorTextNeeded

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

CellFormatting

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

CellLeave

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

CellMouseClick

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

CellMouseDoubleClick

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

CellMouseDown

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

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.

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.

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.

CellMouseUp

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

CellPaint

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

CellParsing

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

CellStateChanged

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

CellStyleChanged

DataGridViewCellEventHandler Fired when the Style property of a DataGridViewCell changes.

CellStyleContentChanged

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

CellToolClick

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

CellToolTipTextChanged

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

CellToolTipTextNeeded

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

CellValidated

DataGridViewCellEventHandler Occurs after the cell has finished validating.

CellValidating

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

CellValueChanged

DataGridViewCellEventHandler Fired when the value of a cell changes.

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.

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.

ColumnAdded

DataGridViewColumnEventHandler Fired when a column is added to the control.

ColumnDisplayIndexChanged

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

ColumnFillWeightChanged

DataGridViewColumnEventHandler Fired when the FillWeight property changes.

ColumnHeaderMouseClick

DataGridViewCellMouseEventHandler Fired when the user clicks a column header.

ColumnHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a column header is double-clicked.

ColumnHeadersHeightChanged

EventHandler Fired when the value of the ColumnHeadersHeight property changes.

ColumnMaximumWidthChanged

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

ColumnMinimumWidthChanged

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

ColumnNameChanged

DataGridViewColumnEventHandler Fired when the Name property changes.

ColumnRemoved

DataGridViewColumnEventHandler Fired when a column is removed from the control.

ColumnSortModeChanged

DataGridViewColumnEventHandler Fired when the value of the SortMode property changes.

ColumnStateChanged

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

ColumnWidthChanged

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

CurrentCellChanged

EventHandler Fired when the CurrentCell property changes.

DataBindingComplete

DataGridViewBindingCompleteEventHandler Occurs after a data-binding operation has finished.

DataError

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

DataMemberChanged

EventHandler Fired when value of the DataMember property changes.

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.

DataSourceChanged

EventHandler Fired when the value of the DataSource property changes.

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.

DefaultRowHeightChanged

EventHandler Fired when the value of the DefaultRowHeight property changes.

DefaultValuesNeeded

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

EditingControlShowing

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

EditModeChanged

EventHandler Fired when the value of the EditMode property changes.

KeepSameRowHeightChanged

EventHandler Fired when the value of the KeepSameRowHeight property changes.

LastCellTab

DataGridViewCellEventHandler Fired when the user tabs past the last cell.

LiveResizeChanged

EventHandler Fired when the value of the LiveResize property changes.

MultiSelectChanged

EventHandler Fired when the value of the MultiSelect property changes.

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.

ReadOnlyChanged

EventHandler Fired when the value of the ReadOnly property changes.

RowCollapsed

DataGridViewRowEventHandler Fired when a parent row is collapsed.

RowEnter

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

RowErrorTextChanged

DataGridViewRowEventHandler Fired when the ErrorText property of a row changes.

RowErrorTextNeeded

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

RowExpanded

DataGridViewRowEventHandler Fired when a parent row is expanded.

RowHeaderMouseClick

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

RowHeaderMouseDoubleClick

DataGridViewCellMouseEventHandler Fired when a row header is double-clicked.

RowHeadersWidthChanged

EventHandler Fired when value of the RowHeadersWidth property changes.

RowHeightChanged

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

RowHeightInfoNeeded

DataGridViewRowHeightInfoNeededEventHandler Fired when information about row height is requested.

RowLeave

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

RowMaximumHeightChanged

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

RowMinimumHeightChanged

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

RowsAdded

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

RowsRemoved

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

RowStateChanged

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

RowValidated

DataGridViewCellEventHandler Occurs after a row has finished validating.

RowValidating

DataGridViewCellCancelEventHandler Fired when a row is validating.

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.

SelectionChanged

EventHandler Fired when the current selection changes.

ShowColumnVisibilityMenuChanged

EventHandler Fired when the value of the ShowColumnVisibilityMenu property changes.

SortCompare

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

Sorted

EventHandler Fired when the DataGridView control completes a sorting operation.

StandardTabChanged

EventHandler Fired when the value of the StandardTab property changes.

ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

TopLeftHeaderClick

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

UserAddedRow

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

UserDeletedRow

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

UserDeletingRow

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

Implements

Name
Description

Bindable components implement this interface.

Controls that support drag & drop operations implement this interface.

Provides access to the ReadOnly property for coontrols that support the read-only mode.

All wisej components implement this interface.

All wisej controls derived from the Control class must implement this interface.

All wisej data stores implement this interface.

Represents a Wisej component that is capable of handling postback requests from the client.

Allows an object to serialize itself.

Last updated