8
Reply

Bind image from folder to gridview in win form application.

Renjith R

Renjith R

Dec 11 2014 3:40 AM
986


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)