DataGridView
Wisej.Web.DataGridView
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.1.0.0)
Represents a data grid control.
C#
VB.NET
public class DataGridView : Control, ISupportInitialize, IWisejDataStore, IWisejHandler, IReadOnly
Public Class DataGridView
Inherits Control
Implements ISupportInitialize, IWisejDataStore, IWisejHandler, IReadOnly
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.
Boolean: Returns or sets whether the user is allowed to delete rows from the DataGridView. (Default:
False
)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
)Boolean: Returns or sets a value that indicates whether the control resizes based on its contents. (Default:
False
)DataGridViewAutoSizeColumnsMode: Returns or sets a value indicating how column widths are determined. (Default:
None
)DataGridViewAutoSizeRowsMode: Returns or sets a value indicating how row heights are determined. (Default:
None
)Throws:
- InvalidOperationException The specified value when setting this property is RowHeader and row headers are hidden.
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.
DataGridViewCellBorderStyle: Returns or sets the cell border style for the DataGridView control. (Default:
Both
)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
)Throws:
DataGridViewCellBorderStyle: Returns or sets the border style for the column headers in the DataGridView control. (Default:
Both
)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.
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
)Throws:
- InvalidOperationException The specified value when setting this property is false and one or more columns have an InheritedAutoSizeMode property value of ColumnHeader.
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.
String: Returns or sets the name of the list or table in the data source for which the DataGridView is displaying data. (Default:
""
)Throws:
- Exception An error occurred in the data source 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.
Object: Returns or sets the data source that the DataGridView is displaying data for. (Default:
null
)Throws:
- Exception An error occurred in the data source 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.
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.
DataGridViewColumnsSortMode: Returns or sets the default SortMode for all columns when the property SortMode is set to NotSet (default). (Default:
Automatic
)Control: Returns the control hosted by the current cell, if a cell with an editing control is in edit mode.
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.
DataGridViewCell: Returns the first cell currently displayed in the DataGridView in the upper left corner.
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.
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.
Throws:
- ArgumentOutOfRangeException The assigned value is less than 0 (see Remarks); or the assigned value is greater than 500.
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.
DataGridViewCell: Returns or set the cell located in the specified column and at the specified row.
DataGridViewCell: Returns or set the cell located in the specified column and at the specified row.
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
)It's better not to touch this value unless you know what you are doing.
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
)String: Returns or sets an HTML string that is displayed when the DataGridView doesn't contain any row. (Default:
""
)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.
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.
Throws:
- ArgumentException The specified value when setting this property is less than 0 or less than 1 and AllowUserToAddRows is set to true.
Throws:
- ArgumentOutOfRangeException The value is less than the minimum width of 2 pixels or is greater than the maximum width of 2000 pixels.
Boolean: Returns or sets whether the column that contains row headers is displayed. (Default:
True
)