Image not displaying in datagridview column in vb.net


Joined
Dec 8, 2019
Messages
1
Reaction score
0
I have the following code that I want to use to display an image in a DataGridView cell:

dgvInventory.Item(7, i).Value = My.Resources.ResourceManager.GetObject("picture")

But instead of displaying the required image, it writes System.Drawing.Bitmap in the cell in the cell.

Please note that the DataGridView table was created at run time, so I know I am supposed to change the column property to be an DataGridViewImageColumn but I just could not figure out how to.

Thanks in advance

Please I really need help with this.
 
Ad

Advertisements

Joined
Mar 14, 2018
Messages
667
Reaction score
219
Well first I need to know if this is a desktop app or a web app? If it's a web app, the right way to display an image is to use the IMG tag and set the SRC attribute to the URL of the image. If it's a desktop app you will probably have to add the right control to the column and then set the IMAGE attribute to the file location.
 

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