Hi,
The Image property specifies an image that is displayed in cells with no values when the column is not data-bound and the cell's ValueIsIcon property is set to false. (From DataGridViewImageColumn.Image MSDN document)
This means if you drag a datagridview to the form, add a imagecolumn to the datagridviewcontrol, and then add the following code in the form_load event, you will see the image.
dataGridView1.Rows.Add(6);
By the way, seems you want to set the default value to the iamgecolumn. You can set the value in DataGridView_DefaultValueNeeded event.
void dataGridView1_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{
e.Row.Cells[“image”].Value = Test1004.Properties.Resources.smile;
}
More information:
DataGridViewImageColumn.Image Property
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewimagecolumn.image.aspx
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.