Show image in DataGrid cell

T

Tim

Hi Guys,

Does anyone know how to show an image in a datagrid cell. I want to display
a 16 x 16 bitmap that can be clicked on to open another form for data
editing.

Can someone help, please???

Tim
 
N

Nicholas Paldino [.NET/C# MVP]

Tim,

You will need to create a custom column that derives from the
DataGridColumnStyle class. You would use this to display your image.

This assumes you are using a windows forms data grid.

When you create it, you can render the image yourself (it shouldn't be
too hard). You can just load the image up from the byte array in the column
(the column type should be a byte array, at least) and then draw the image
in the space.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top