Image in Grid Cell

sachmo

Member
Joined
Aug 2, 2007
Messages
14
Programming Experience
Beginner
Hey, I am using the Datagridview control and I set up one column as a ViewImageColumn and I want to be able to set each cell in this column to a specific picture based on criteria met in code during runtime. For starters, can I see an example of just programmaticaly setting the image in the cell. My grid is populated by code in a for loop, so I need to do this in my loop. But, an example of setting the image in code would be fine. Also, I am using an imagelist control which my images will come from.

TIA
 
Where the DataGridViewImageColumn is the first column (0):
VB.NET:
DataGridView1.Item(0, 1).Value = ImageList1.Images(0)
 
Back
Top