Converting and displaying a byte array as an image in a datagrid [duplicate]
Possible Duplicate:
how to display converted byte array as image in datagrid
I have inserted images into a sql database. I want to display these images in a datagrid. Currently in my datagrid, I just have a image col开发者_如何学Goumn and each cell in that column just says Byte[]Array. So i need to convert these byte arrays back to an image and then display these images in the datagrid. I am drawing a blank as to how to do this. any help is appreciated. Thanks
You will probably need to inherit from DataGridViewCell and create you own that can convert the byte array to a Bitmap and draw it on herself.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.aspx
Then with this sample here you'll learn how to use it on your datagrid.
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.aspx
精彩评论