I have a WinForms application with several datagridviews. On one of them, I have a column that is dynamically populated with images. I have included the screenshot below:

Many of the cells do not meet the requirements for image generation and therefore appear empty. However, when this happens, the application shows the default red X without an image. I want the cells to just appear empty and not display this image by default.
I tried to create an empty image, but this causes its own problem; namely because my datagridview has alternating row colors, a white image appears against gray rows and vice versa.
Essentially, I want a blank or empty or transparent image that just doesn't appear at all in the column when the runtime requirements for one of the other images are not met.
For completeness, the code I'm currently using is as follows:
foreach (DataGridViewRow row in dataCaseHistory.Rows) { DataGridViewCell cell = row.Cells["DocID"]; if (cell.Value.ToString().Length > 0) { if (((int)cell.Value) % 2 == 0) { row.Cells["Doc"].Value = (System.Drawing.Image)Properties.Resources.Paperclip___done; } else { row.Cells["Doc"].Value = (System.Drawing.Image)Properties.Resources.Bundle___done; } } else { row.Cells["Doc"].Value = null; } }
Logical tests for image selection are temporary. I'm just trying to set everything up before applying real, more attractive criteria for selecting an image.
source share