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 3491130
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:36:00+00:00 2026-05-18T11:36:00+00:00

I have a form with a datagridview control on it. The datagridview is bound

  • 0

I have a form with a datagridview control on it.

The datagridview is bound to a DataView which in turn is populated from a DataTable. The app works fine in it’s current state, but now I want to modify it so as to introduce a new column in to the datagrridview. The new column is to be an icon.

I am assuming that somehow I need to create a new column for the icon in the DataTable so it can flow through to the datagridview. Any help on how I can achieve this.

Cut down version of the code is

private DataTable _tableDT = new DataTable("dt");
private DataView _viewDT = new DataView();

_viewDT.Table = _tableDT;
_tableDT.Columns.Add("Name", typeof(string));
_tableDT.Columns.Add("Desc", typeof(string));

// populate data table
_tableDT.Rows.Add(.....)

dataGridView1.DataSource = _viewDT;

Also, as an additional question. Can a column have both an icon and text in it. (i.e. ideally the new column would have an icon to the left hand side followed by some text ).

  • 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-18T11:36:00+00:00Added an answer on May 18, 2026 at 11:36 am

    Have a little read of this. It’s in VB but it’s easy enough to interpret.

    http://arsalantamiz.blogspot.com/2008/04/how-to-display-row-icon-in-datagridview.html

    Alternatively, if you’re reading the image in from a database, you can just get the DataGridView to do all the hard work, simply by adding a new DataGridViewImageColumn column. By overriding the CellPainting event you can specify the image based upon the row data.

    http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/4f3c8d15-f1f5-4d62-9f26-8a04f683a210

    Hope this helps, Tom 🙂

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

Sidebar

Related Questions

I have a DataGridView control in a winforms app that I'm working on. The
I have a DataGridView bound to a bindingsource which is bound to a List<T>
I have a DataGridView object to which I've bound a list of objects (of
I have subclassed Form to include some extra functionality, which boils down to a
I have a form in which people will be entering dollar values. Possible inputs:
I have a base form class that contains a method that returns a DataTable:
I have a DataGridView bound to a BindingSource. Each row has three fields: Name,
I have a Dictionary bound to DataGridView by using following sample code. DataGridView bound
( .NET 2.0, System.Windows.FormsDataGridView and DataTable ) I have 1 datagrid connected to 1
I have form area in my view. If I click button A , I

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.