asad ahmad

asad ahmad

  • NA
  • 13
  • 502

datagrid view is not showing images

Sep 25 2016 10:38 AM
while(rdr.Read())
{
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
ImageConverter ic;
Image img;
Byte[] cbyte;
ic = new ImageConverter();
cbyte = (Byte[])(rdr["Imge"]);
img = (Image)ic.ConvertFrom(cbyte);
Bitmap a = new Bitmap(img);
iconColumn.Image = a;
iconColumn.Name = "Tree";
iconColumn.HeaderText = "Nice tree";
dataGridView1.Columns.Insert(0, iconColumn);
};

Answers (2)