System.Windows.Forms.DataGridViewImageCell Class

Displays a graphic in a System.Windows.Forms.DataGridView control.

See Also: DataGridViewImageCell Members


public class DataGridViewImageCell : DataGridViewCell


The System.Windows.Forms.DataGridViewImageCell class is a specialized type of System.Windows.Forms.DataGridViewCell used to display an System.Drawing.Image or an System.Drawing.Icon, depending on the value of the DataGridViewImageCell.ValueIsIcon property. Typically, the DataGridViewCell.ReadOnly property of a System.Windows.Forms.DataGridViewImageCell is set to true to indicate that the user cannot edit the cell contents.

The System.Windows.Forms.DataGridViewImageColumn is the column type specialized to hold cells of this type. By default, the DataGridViewImageColumn.CellTemplate is initialized to a new System.Windows.Forms.DataGridViewImageCell. To pattern the cells within a column after an existing System.Windows.Forms.DataGridViewImageCell, set the column's DataGridViewImageColumn.CellTemplate property to the cell to use as a pattern.

The cell-related properties of the column are wrappers for the similarly-named properties of the template cell. Changing the property values of the template cell will affect only cells based on the template that are added after the change. Changing the cell-related property values of the column, however, will update the template cell and all other cells in the column, and refresh the column display if necessary.


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