System.Windows.Forms.DataGridViewImageCell.ValueIsIcon Property

Gets or sets a value indicating whether this cell displays an System.Drawing.Icon value.

Syntax

[System.ComponentModel.DefaultValue(false)]
public bool ValueIsIcon { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

To ensure that the alpha channel of System.Drawing.Icon values is painted correctly, set this property to true. When this property is true, the DataGridViewImageCell.FormattedValueType and DataGridViewImageCell.ValueType properties return a Type object representing the System.Drawing.Icon type.

Setting the DataGridViewImageColumn.ValuesAreIcons property of the owning column also sets the DataGridViewImageCell.ValueIsIcon property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value.

When the value of this property changes for a cell in the row for new records, the image displayed in the cell is updated to the current value of the DataGridViewImageCell.DefaultNewRowValue property.

Unlike the column DataGridViewImageColumn.ValuesAreIcons property, the cell DataGridViewImageCell.ValueIsIcon property does not automatically update the DataGridViewCellStyle.NullValue property of the associated cell style when you change its value. When you change the cell DataGridViewImageCell.ValueIsIcon property value to true, be sure to set the DataGridViewCellStyle.NullValue property of the object returned by the DataGridViewCell.Style property to a valid System.Drawing.Icon. When you change the DataGridViewImageCell.ValueIsIcon property value to false, be sure to set the DataGridViewCellStyle.NullValue property to a valid System.Drawing.Image.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0