Flá*_*sta 8 c# datagridview image
我有一个字段DataGridViewImageColumn,对于字段的每一行,根据条件,我添加一个不同的图像.任何人都知道如何在Windows窗体中执行此操作?
if (dgvAndon.Rows[e.RowIndex].Cells["urgencyOrder"].ToString() == "1")
{
//Here I want to add the image in the image property field DataGridViewImageColumn.
}
Run Code Online (Sandbox Code Playgroud)
DataGridViewImageColumn在你的.添加一个DataGridView以这种方式添加图片:
for (int row = 0; row <= [YourDataGridViewName].Rows.Count - 1; row++)
{
((DataGridViewImageCell)gvFiles.Rows[row].Cells[1]).Value = Properties.Resources.Picture1
}
Run Code Online (Sandbox Code Playgroud)