Good morning,
I want to show image (16*16px png file) in DataGridView. This Grid has 3 columns: text cell, text cell, image cell. Here is sample, how I try set image:
private void showData(List<Item> collection)
{
gwQuestions.AutoGenerateColumns = false;
gwQuestions.DataSource = addNotSet(collection);
foreach (DataGridViewRow row in gwQuestions.Rows)
{
DataGridViewImageCell cell = row.Cells[2] as DataGridViewImageCell;
cell.ValueType = typeof(System.Drawing.Image);
if (collection[row.Index].Result)
{
cell.Value = (System.Drawing.Image)Properties.Resources.Check;
}
else
{
cell.Value = (System.Drawing.Image)Properties.Resources.Cancel;
}
}
}
But in grid i show only red cross on paper, like File not found error. Can you help me please?