Export (0) Print
Expand All

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)

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

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

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft