Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6014265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:40:02+00:00 2026-05-23T02:40:02+00:00

I want to show in dataGridView some image. I have two components, dataGridView, dataTable

  • 0

I want to show in dataGridView some image. I have two components, dataGridView, dataTable and one Bitmap. DataTable has two columns.

dataGridview.source = dataTable;

Now, I want to show in dataGridView three columns, two from dataTable and new third with my bitmap. If it is easier, I can modify dataTable and dataGridView.

Is it possible to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:40:03+00:00Added an answer on May 23, 2026 at 2:40 am

    There are several ways you can approach this.

    There is an image column type for the DataGridView, the DataGridViewImageColumn, which has an image property that you can pass a bitmap to.

    Something like the following should work:

    private void createGraphicsColumn(Bitmap image)
    {
        DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
        imageColumn.Image = image;
        imageColumn.Name = "Tree";
        imageColumn.HeaderText = "Nice tree";
        dataGridView1.Columns.Insert(2, imageColumn);
    }
    

    You can also set the Value property of individual cells in this column if needed.

    The example above plus a whole lot of other discussion can be found on MSDN.


    Another option is to add your image into the datatable – this will automatically generate your image column, but the new column in the datatable needs to be of type byte array.

    I found the following code to do this with a quick google:

    public byte[] imageToByteArray(System.Drawing.Image imageIn)
    {
        MemoryStream ms = new MemoryStream();
        imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
        return  ms.ToArray();
    }
    

    If you do take this approach I’d suggest doing a little research to find the best method of creating the byte array – I couldn’t vouch for that code being the best.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I display some objects that have thumbnails in two ways: one in a DataGridView,
I want to use datagridview for show some data(information) to user. My datagridview has
I have a datagridview to show my entries and i want a print out
I am populating one DataGridView in C# windows application. I have one DataTable in
Say I have a DataGridView Control, this grid is filled through a DataTable. Now,
I have a DataGridView filled with productinformation. The datagridview has totally 50 columns but
Good morning, I want to show image (16*16px png file) in DataGridView. This Grid
I have a datagridview where I show infomation about products. I want to bind
I have some question about DataGridView . I can show table in DataGridView ,
I want to show HTML content inside Flash. Is there some way to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.