Renjith R

Renjith R

  • NA
  • 14
  • 6.9k

Bind image from folder to gridview in win form application.

Dec 11 2014 3:40 AM


I need to bind image from a folder to gridview in windows form application.
i have tried this code and its not giving the proper image.
Is there any problem with the path ?


 Image image = Image.FromFile(@"D:\MHTTest\FinalImages\1.png");
            DataGridViewImageColumn ImageColumn = new DataGridViewImageColumn();
            ImageColumn.Image = image;
            ImageColumn.Name = "Name";
            ImageColumn.HeaderText = "Nice Name";
            ImageColumn.Width = 200;
            dataGridView1.Columns.Add(ImageColumn);


Answers (8)