Hello,
How to image show or display in datagridview
existing column in c# .net windows application?
I want to display images in these column.
How it can be possible.
FloorTexture1|FloorTexture2|FloorTexture3|FloorTexture4|FloorTexture5|FloorTexture6
System.Drawing.Bitmap|Library\asd.png|Library\aaa.png|Library\sss.png|Library\eee.png|Library\qqq.png
and all datatypes are varchar(max).
I want to display only image in these column.
I am writing this code for display image but it's not displaying.
foreach (DataGridViewRow row1 in dgvDisplayTiles.Rows)
{
string imgPath = System.IO.Path.Combine(Application.StartupPath + row1.Cells[3].Value.ToString());
if (imgPath!=null)
{
row1.Cells[3].Value = (Bitmap)System.Drawing.Image.FromFile(imgPath, true);
}
else
{
MessageBox.Show("Invalid Path");
}
}
But only display "System.Drawing.Bitmap" in datagrdiview image column.
Please help me, It's urgent.
Thanks in Advance.
Ankit Agarwal
Software Engineer