我试图在datagridview中向特定单元格显示图像,但我不能。有帮助吗?它返回错误,如system.drawing ....我正在使用的代码是:
foreach (DataGridViewRow r in dataGridView1.Rows)
{
if (Convert.ToString(r.Cells[6].Value) == "Cancelled")
{
Image image = Image.FromFile(@"C:\Users\Elias-PC\Documents\Visual Studio 2012\Projects\FIDs Display\FIDs Display\bin\Debug\ET.PNG");
r.Cells[6].Value = image;
//r.DefaultCellStyle.BackColor = Color.Red;
r.Cells[6].Style.BackColor = Color.Red;
}
}