DataGridViewImageColumn.ValuesAreIcons Property

 

Gets or sets a value indicating whether cells in this column display Icon values.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[BrowsableAttribute(false)]
public bool ValuesAreIcons { get; set; }

Property Value

Type: System.Boolean

true if cells display values of type Icon; false if cells display values of type Image. The default is false.

Exception Condition
InvalidOperationException

The value of the CellTemplate property is null.

To ensure that the alpha channel of Icon values is painted correctly, set this property to true.

Getting or setting this property gets or sets the ValueIsIcon property of the object returned by the CellTemplate property. Setting this property 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.

If the NullValue property of the object returned by the DefaultCellStyle property has a value equal to the standard error graphic of type Bitmap, changing the ValuesAreIcons property value to true automatically sets NullValue to the standard error graphic of type Icon. If NullValue has a value equal to the standard error graphic of type Icon, changing the ValuesAreIcons property value to false automatically sets NullValue to the standard error graphic of type Bitmap.

.NET Framework
Available since 2.0
Return to top
Show: