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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:09:04+00:00 2026-06-03T02:09:04+00:00

Been playing with the UI of my program and have a little function that

  • 0

Been playing with the UI of my program and have a little function that compares to cells on the same row and assigns a colour to that cell.
What I actually want now is to simply add an image UP or DOWN arrow to that cell. Unfortunately there seems to be no one liner which I find hard to believe.

Here’s my current code:

DataGridViewImageCell p1 = new DataGridViewImageCell();

ParetoGrid.Columns.Add(new DataGridViewColumn() { CellTemplate = p1, FillWeight = 1, HeaderText = "p1", Name = "p1", Width = 30});




private void ShowArrow()
    {
        foreach (DataGridViewRow paretoRow in ParetoGrid.Rows)
        {
            if ((paretoRow.Cells["Pareto6"].Value != null) &&   (Convert.ToInt32(paretoRow.Cells["CurrentPareto"].Value) < (Convert.ToInt32(paretoRow.Cells["NewPareto"].Value))))
            {
                paretoRow.Cells["p1"].Value = //image?;
            }
            else if ((paretoRow.Cells["Pareto6"].Value != null) && (Convert.ToInt32(paretoRow.Cells["CurrentPareto"].Value) > (Convert.ToInt32(paretoRow.Cells["NewPareto"].Value))))
            {
                ParetoGrid.Rows[paretoRow.Index].DefaultCellStyle.BackColor = Color.LightGreen;
            }


        }
    }

Im hoping someone knows that there is a one liner. Oh and the column I want to add an image too is a DataGridViewImageCell.

Many thanks!

so far I simply create a new Image and then

paretoRow.Cells["p1"].Value = theImage;

Problem I get is ERROR:formated cell has wrong type!

  • 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-06-03T02:09:05+00:00Added an answer on June 3, 2026 at 2:09 am

    You should use DataGridTemplateColumn contains image control. General column dosen’t support to show image.

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

Sidebar

Related Questions

I have been playing around with Template functions, and made a little logger program.
I have been playing around with some debugging and wrote some C code that
I have tried writing program that plays a sound file but have been unsuccessful
I've been playing with hard links lately on a program that copies files all
I've been playing with Python for a while and wrote a little program to
I have been playing around a bit with a fairly simple, home-made search engine,
I have been playing around with the MVP pattern using winforms for the last
Lately I have been playing around with intents and bundles. I thought I had
I've been playing around with subscribing elements to AJAX events in jQuery. I have
I have been playing round with the Async CTP this morning and have a

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.