Skip to main content
Version: 4.1

DataGridViewColumn

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a column in a DataGridView control.

public class DataGridViewColumn : DataGridViewBand, IWisejComponent, IWisejSerializable, IComponent, IHasResponsiveProfiles

Constructors​

Instance member DataGridViewColumn()​

Initializes a new instance of the DataGridViewColumn class to the default state.

Instance member DataGridViewColumn(cellTemplate)​

Initializes a new instance of the DataGridViewColumn class using an existing DataGridViewCell as a template.

NameTypeDescription
cellTemplateDataGridViewCellAn existing DataGridViewCell to use as a template.

Properties​

Instance member AllowHtml​

Boolean: Returns or sets a value indicating that the column can display HTML text. (Default: False)

When AllowHtml is set to true, the text in the cell can contain HTML content. If the text contains new lines (CRLF) but doesn't contain HTML elements (at least one "<") all CRLF are automatically substituted with "<br/>".

Instance member AllowMarkdown​

Boolean: Returns or sets a value indicating that the column can display markdown text. (Default: False)

Instance member AutoEllipsis​

Boolean: Returns or sets whether the ellipsis character (...) appears at the right edge of the header text denoting that the text extends beyond the size of the header. (Default: False)

Value: true to show the ellipsis; otherwise, false. The default is false.

Instance member AutoSizeMode​

DataGridViewAutoSizeColumnMode: Gets or sets the mode by which the column automatically adjusts its width. (Default: NotSet)

Value: A DataGridViewAutoSizeColumnMode value that determines whether the column will automatically adjust its width and how it will determine its preferred width. The default is NotSet.

Throws:

Instance member CellRenderer​

String: Returns or sets the name of the default cell renderer to use on the client side to render the cells that belong to this column. If it's null or empty it defaults to "Cell".

The name of the cell renderer can be a fully qualified class name (i.e. "wisej.web.datagrid.cellRenderer.Cell") or just the class name (i.e. "ImageCell") in which case the client library prepends "wisej.web.datagrid.cellRenderer".

Instance member CellTemplate​

DataGridViewCell: Returns or sets the template used to create new cells.

Value: A DataGridViewCell that all other cells in the column are modeled after.

Throws:

Instance member CellType​

Type: Returns the run-time type of the cell template.

Value: The Type of the DataGridViewCell used as a template for this column. The default is null.

Instance member ClientIndex​

Int32: Returns the column index on the client, accounting for the header column.

Instance member CommandPropertyName​

String: Returns or sets the name of the data source property or database column to which the Command is bound. (Default: "")

Value: The case-insensitive name of the property or database column associated with the Command property.

Instance member ContextMenu​

ContextMenu: Gets or sets the context menu for the column. (Default: null)

Value: The ContextMenu associated with the current DataGridViewColumn. The default is null.

Instance member DataGridView​

DataGridView: Returns the DataGridView control associated with this element.

Value: A DataGridView control that contains this element. The default is null.

Instance member DataPropertyName​

String: Returns or sets the name of the data source property or database column to which the DataGridViewColumn is bound. (Default: "")

Value: The case-insensitive name of the property or database column associated with the DataGridViewColumn.

Instance member DefaultCellStyle​

DataGridViewCellStyle: Returns or sets the column's default cell style.

Value: A DataGridViewCellStyle that represents the default style of the cells in the column.

Instance member DefaultMinimumSize​

Int32: Returns the default minimum width saving an entry in the property store.

Instance member DefaultSize​

Int32: Returns the default width saving an entry in the property store.

Instance member DisplayIndex​

Int32: Returns or sets the display order of the column relative to the currently displayed columns.

Value: The zero-based position of the column as it is displayed in the associated DataGridView, or -1 if the band is not contained within a control.

Throws:

  • ArgumentOutOfRangeException DataGridView is not null and the specified value when setting this property is less than 0 or greater than or equal to the number of columns in the control; or DataGridView is null and the specified value when setting this property is less than -1; or the specified value when setting this property is equal to MaxValue.

Instance member Editor​

Control: Returns or sets the editor component used to edit cells in this column.

Instance member FillWeight​

Single: Returns or sets a value that represents the width of the column when it is in fill mode relative to the widths of other fill-mode columns in the control. (Default: 100)

Value: A Single representing the width of the column when it is in fill mode relative to the widths of other fill-mode columns. The default is 100.

Throws:

Instance member Frozen​

Boolean: Returns or sets whether a column will move when a user scrolls the DataGridView control horizontally. (Default: False)

Value: true to freeze the column; otherwise, false.

Instance member HasResponsiveProfiles​

Boolean: Check if the component defines any responsive profile without forcing the creation of the collection.

Instance member HeaderCell​

DataGridViewColumnHeaderCell: Returns or sets the DataGridViewColumnHeaderCell that represents the column header.

Value: A DataGridViewColumnHeaderCell that represents the header cell for the column.

Instance member HeaderImage​

Image: Returns or sets the image that is displayed in a column header.

Value: The Image displayed in the column header. The default value is null.

Instance member HeaderImageSource​

String: Returns or sets the theme name or URL for the image to display in the column header.

Value: The theme name or URL for the image to display in the column header. The default value is null.

Instance member HeaderStyle​

DataGridViewCellStyle: Returns or sets the column's header style.

Instance member HeaderText​

String: Returns or sets the caption text on the column's header cell.

Value: A String with the desired text. The default is an empty string ("").

Instance member InheritedAutoSizeMode​

DataGridViewAutoSizeColumnMode: Returns the sizing mode in effect for the column.

Value: The DataGridViewAutoSizeColumnMode value in effect for the column.

Instance member InheritedSortMode​

DataGridViewColumnSortMode: Returns the sort mode in effect for the column.

Value: The DataGridViewColumnSortMode value in effect for the column.

Instance member IsDataBound​

Boolean: Gets a value indicating whether the column is bound to a data source.

Value: true if the column is connected to a data source; otherwise, false.

Instance member IsRow​

Boolean: Returns true when the implementation class is DataGridViewRow.

Instance member MaximumWidth​

Int32: Returns or sets the maximum width, in pixels, of the column. (Default: 32000)

Value: The number of pixels that specifies the maximum width of the column. The default is 32000.

Throws:

Instance member MinimumWidth​

Int32: Returns or sets the minimum width, in pixels, of the column. (Default: 10)

Value: The number of pixels that specifies the minimum width of the column. The default is 10.

Throws:

Instance member Movable​

DataGridViewTriState: Returns or sets whether the user can move the column.

Value: One of the DataGridViewTriState values. The default is True.

Setting this property to NotSet inherits the value of AllowUserToOrderColumns. Otherwise the value of this property overrides the behavior determined in AllowUserToOrderColumns.

Instance member Name​

String: Returns or sets the name of the column.

Value: The name of the column. The default is an empty string ("").

Instance member ReadOnly​

Boolean: Returns or sets whether the user can edit the column's cells. (Default: False)

Value: true if the user cannot edit the column's cells; otherwise, false.

Throws:

Instance member Resizable​

DataGridViewTriState: Returns or sets whether the column is resizable.

Value: One of the DataGridViewTriState values. The default is True.

Instance member Selected​

Boolean: Returns or sets whether the column is selected.

Value: true if the row is selected; otherwise, false.

Instance member ShowInVisibilityMenu​

Boolean: Returns or sets whether the column should be included in the visibility menu. (Default: True)

Protected member Sortable​

Boolean: Returns whether the column can be sorted automatically.

Instance member SortMode​

DataGridViewColumnSortMode: Returns or sets the sort mode for the column. (Default: NotSet)

Value: A DataGridViewColumnSortMode that specifies the criteria used to order the rows based on the cell values in a column.

Instance member ToolTipText​

String: Returns or sets the text used for ToolTips. (Default: "")

Value: The text to display as a ToolTip for the column.

Instance member UserPaint​

Boolean: Enables or disables the user paint feature for all the cells in this column. When UserPaint is true, the application can handle the CellPaint event to draw custom content in each cell. (Default: False)

Instance member ValueType​

Type: Returns or sets the data type of the values in the column's cells.

Value: A Type that describes the run-time class of the values stored in the column's cells.

Instance member Visible​

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

Value: true if the column is visible; otherwise, false.

Instance member Width​

Int32: Returns or sets the current width of the column.

Value: The width, in pixels, of the column. The default is 100.

Throws:

Methods​

Instance member Clone()​

Returns: Object. An Object that represents the cloned DataGridViewColumn.

Protected member Dispose(disposing)​

Disposes of the resources used by the DataGridViewColumn and removes from the parent data grid view.

ParameterTypeDescription
disposingBoolean

Protected member OnAddReferences(list)​

Returns a collection of referenced components or collection of components.

ParameterTypeDescription
listIListList of referenced components or collection of components.

Protected member OnDataGridViewChanged()​

Called when the element is associated with a different DataGridView.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member ResetWidth()​

Resets the width to the default value.

Instance member Update()​

Updates the component on the client.

Instance member Update(property)​

Forces the server to send back the specified property.

ParameterTypeDescription
propertyString

Events​

Instance member Disposed​

EventHandler Fired when the DataGridViewColumn is disposed.

Inherited By​

NameDescription
DataGridViewButtonColumnRepresents a DataGridView column that contains a collection of DataGridViewButtonCell cells.
DataGridViewCheckBoxColumnRepresents a DataGridView column that contains a collection of DataGridViewCheckBoxCell cells.
DataGridViewComboBoxColumnRepresents a DataGridView column that contains a collection of DataGridViewComboBoxCell cells.
DataGridViewDateTimePickerColumnRepresents a DataGridView column that contains a collection of DataGridViewDateTimePickerCell cells.
DataGridViewImageColumnRepresents a DataGridView column that contains a collection of DataGridViewImageCell cells.
DataGridViewLinkColumnRepresents a DataGridView column that contains a collection of DataGridViewLinkCell cells.
DataGridViewMaskedTextBoxColumnRepresents a DataGridView column that contains a collection of DataGridViewTextBoxCell cells.
DataGridViewNumericUpDownColumnRepresents a DataGridView column that contains a collection of DataGridViewNumericUpDownCell cells.
DataGridViewTextBoxColumnRepresents a DataGridView column that contains a collection of DataGridViewTextBoxCell cells.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IWisejComponentAll wisej components implement this interface.
IWisejSerializableAllows an object to serialize itself.