There are many ways to skin this old cat. When choosing the way, you must first decide when should the adding of images take place. I chose to add images during sorting.

Let us assume you already added some data to gridview via datatable using ;

So now you know we have a filled up dataGridView.

Now let us assume in the dataGridView1 we want to add images according to the data within the 6th column. So what we first need to do is to create an image column by writing;

Now we have a image column. With the name “img” with the header “Image Column” As you can see in the 5th line I have stated that my images are actually icons. The reason I did this was that I found out that icons take up less space and flickers less. You can if you want change this option as you see fit.

Now let us get cracking and add those images according to the columns;


I hope this has been informative. Please do tell if you see any mistakes and wish to make suggestions.

Have fun!

John Roach

Related Posts
Comments ( 18 )
  1. Mike
    March 2, 2012 at 10:35 pm

    Hello…thanks for posting…..what does “SUT” standfor?

    • John Roach
      March 5, 2012 at 2:25 pm

      Oh that is the namespace of the program in Turkish it is a acronym for SÜT : Sipariş Ürün Teslim which means in English OPD: Order Product Delivery.
      I used this part of the code in another program. Forgot to rename it.

  2. Sneha
    May 16, 2012 at 4:38 pm

    Thank You So much

  3. Manish Taroliya
    May 30, 2012 at 10:13 am

    Thanks Dude…!!

  4. Sathiya
    June 25, 2012 at 9:08 am

    Thank u so much.. nice..

  5. raj
    September 23, 2012 at 6:10 pm

    what is the use of line 6 nd 11 plz describe…………


    • John Roach
      September 23, 2012 at 9:19 pm

      I think you are talking of :
      6: Icon image = SUT.Properties.Resources.succcess_icon;
      7: dataGridView1.Rows[i].Cells[“img”].Value = image;

      The 6th line sets the icon “image” to the succcess_icon image from the resources. (SUT is the namespace in which I added the resource) The 7th line adds the icon “image” to the “img” cell.

      11 does the same thing.

  6. Maggi
    December 6, 2012 at 6:46 am

    which one will i place in the place of SUT
    please explain

    • John Roach
      December 6, 2012 at 11:53 am

      Sut is your namespace.

    February 13, 2013 at 12:06 am

    This specific article, “How to add images to
    DataGridView cell using C# and Windows Forms | John Roach” was in
    fact very good. I am making out a backup to
    demonstrate to my personal close friends. Thanks-Danuta

  8. suraj
    April 2, 2013 at 8:38 pm

    thanks a lot

  9. Muthulakshmi.S
    August 31, 2013 at 10:19 am

    How to add two different image in datagridview??

  10. jaseem
    January 16, 2014 at 3:37 pm

    Instead of SUT what i have to use

    • John Roach
      January 17, 2014 at 12:16 pm

      You have to write your own namespace.

  11. Matimu A
    January 17, 2014 at 9:59 am

    Which event did you use to insert pictures on a cell when you click it?

    • John Roach
      January 17, 2014 at 12:16 pm

      I have added the images at sort.

Leave a reply
Captcha Click on image to update the captcha .