DataGridViewImageColumn::Icon Property

 

Gets or sets the icon displayed in the cells of this column when the cell's Value property is not set and the cell's ValueIsIcon property is set to true.

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

public:
[BrowsableAttribute(false)]
property Icon^ Icon {
	Icon^ get();
	void set(Icon^ value);
}

Property Value

Type: System.Drawing::Icon^

The Icon to display. The default is null.

The Icon property specifies an icons that is displayed in cells with no values when the column is not data-bound and the cell's ValueIsIcon property is set to true. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed.

Using the Icon property rather than the Image property ensures that an alpha channel in an icon is painted correctly. If you want to display an Image instead of an Icon, set the Image property instead and set the ValuesAreIcons property to false. You can also set the ValueIsIcon property of individual cells to indicate whether the cell displays the Image or the Icon property value.

.NET Framework
Available since 2.0
Return to top
Show: