Skip to main content
Version: 4.1

DataGridViewCellStyle

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents the formatting and style information applied to individual cells within a DataGridView control.

public class DataGridViewCellStyle : ICloneable, IHasPropertyStore, IDisposable

Constructors​

Instance member DataGridViewCellStyle()​

Initializes a new instance of the DataGridViewCellStyle class using default property values.

Properties​

Instance member Alignment​

DataGridViewContentAlignment: Returns or sets a value indicating the position of the cell content within a DataGridViewCell cell. (Default: NotSet)

Instance member BackColor​

Color: Returns or sets the background color of a DataGridViewCell cell.

Instance member BackgroundImage​

Image: Returns or sets the background image displayed in a DataGridViewCell cell. (Default: null)

Instance member BackgroundImageAlign​

ContentAlignment: Returns or sets the background image alignment as defined in the ContentAlignment enumeration. (Default: MiddleLeft)

Instance member BackgroundImageLayout​

ImageLayout: Returns or sets the background image layout as defined in the ImageLayout enumeration. (Default: None)

Instance member BackgroundImageSource​

String: Returns or sets the theme name or URL for the background image displayed in a DataGridViewCell cell. (Default: null)

Instance member ColSpan​

Int32: Returns or sets the number of columns that this cell can use to render its content. (Default: 1)

Throws:

Instance member CssClass​

String: Returns or sets additional CSS class names to add to the DataGridViewCell.

Instance member CssStyle​

String: Returns or sets the custom CSS styles to apply to the DataGridViewCell.

You can use any CSS style string.



// add a double underline to the cell.
this.dataGridView1[3, 4].Style.CssStyle = "border-bottom:2px solid black";


Instance member DataSourceNullValue​

Object: Returns or sets the value saved to the data source when the user enters a null value into a cell.

Instance member Font​

Font: Returns or sets the font applied to the textual content of a DataGridViewCell cell.

Instance member ForeColor​

Color: Returns or sets the foreground color of a DataGridViewCell cell.

Instance member Format​

String: Returns or sets the format string applied to the textual content of a DataGridView cell.

Instance member FormatProvider​

IFormatProvider: Returns or sets the object used to provide culture-specific formatting of DataGridView cell values.

Instance member IsDataSourceNullValueDefault​

Boolean: Returns a value indicating whether the DataSourceNullValue property has been set.

Instance member IsFormatProviderDefault​

Boolean: Returns a value that indicates whether the FormatProvider property has been set.

Instance member IsNullValueDefault​

Boolean: Returns a value indicating whether the NullValue property has been set.

Instance member NullValue​

Object: Returns or sets the DataGridView cell display value corresponding to a cell value of Value or null.

Instance member Padding​

Padding: Returns or sets the space between the edge of a DataGridViewCell and its content.

Instance member RowSpan​

Int32: Returns or sets the number of rows that this cell can use to render its content. (Default: 1)

Throws:

Instance member Scope​

DataGridViewCellStyleScopes: Returns the scope (the type of object) that owns the cell style.

Instance member Tag​

Object: Returns or sets an object that contains additional data related to the DataGridViewCellStyle.

Instance member WrapMode​

DataGridViewTriState: Returns or sets whether textual content in a DataGridViewCell cell is wrapped to subsequent lines or truncated when it is too long to fit on a single line.

Methods​

Instance member Clone()​

Creates an exact copy of this DataGridViewCellStyle.

Returns: DataGridViewCellStyle. A DataGridViewCellStyle that represents an exact copy of this cell style.

Instance member Dispose()​

Releases all resources used by the DataGridViewCellStyle.

Protected member Dispose(disposing)​

Releases the resources used by the DataGridViewCellStyle.

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