You can use an enumeration attribute to accomplish this. Make sure the enumeration values you will use have an icon associated with them. Then in the datagrid, when you add the enumeration attribute as a column you have the option of selecting Enumeration format of Text or Image.
You can view the documentation here: https://docs.mendix.com/refguide/columns/#231-enumeration-format
In a standard datagrid you can use an enumeration attribute. Set the image in the enumeration’s values and make sure the column in your grid is displaying image in stead of the text value (see properties of the column).
In a datagrid2 widget you can simply add an image and with the visibility settings you can show/hide the image based on an expression or attributes of type boolean or enumeration.
Hope this helps in finding your solution.