I’m working on a WindowsForm project and in my form I have a DataGridView with a DataGridViewImageColumn which must show the status of the row (enabled/disabled) using an image.
I have a DataTable that I bind to my datagrid. In this table there is a column that is the status of each row and is a text field.
How can I bind this column to the DataGridViewImageColumn showing the right image?
Whenever I have questions on how to do things in a DataGridView I consult Microsoft’s FAQ first.
http://www.windowsclient.net/Samples/Go%20To%20Market/DataGridView/DataGridView%20FAQ.doc
Typically what I do in that situation is handle the CellFormatting event to set the image based on the value in the cell.
So I would store my images in something like an image list, then have code in CellFormatting like the following: