DataGridViewImageCell.ValueIsIcon Property

Definition

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

public bool ValueIsIcon { get; set; }

Property Value

true if this cell displays an Icon value; otherwise, false.

Remarks

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

Setting the ValuesAreIcons property of the owning column also sets the 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 DefaultNewRowValue property.

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

Applies to

Ürün Sürümler
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also