473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

get image value from DataGridViewImageColumn?

Hi.

I have not bounded DataGridView with some DataGridViewImageColumn-s in my project. Cells in this columns contains different images (see attached picture). I want to somehow get image value of clicked cell and do some action according on which image the cell contains.

I tried something like this:
Expand|Select|Wrap|Line Numbers
  1. private void myGrid_CellContentClick
  2. (object sender, DataGridViewCellEventArgs e)
  3. {
  4.      if (myGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.Equals
  5.         (global::nameSpace.Properties.Resources.greenFill))
  6.      { 
  7.          //do something
  8.         MessageBox.Show("Image is green");
  9.      }
  10. }
  11.  
but this do not work :/.

Im new to C# so sorry for stupid question. Hope, it is understandable.

Thanks for answers. :)
Attached Images
File Type: jpg cells.jpg (27.1 KB, 115 views)
Nov 11 '09 #1
0 1970

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
0
by: None | last post by:
Hi, I'm using DataGridView in my Windows Forms project. I need to know how we can insert an image into the specified cell . I tried with the following code.
2
by: Marc Solé | last post by:
Hello, I want to insert an image to a specific column of a dataGridWiew. I explain what I'm doing: - I define the ColumnType as a DataGridViewImageColumn. - I select the image (an icon of...
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
0
by: wizardworkz | last post by:
Hello All! Having a bit of a problem combining php with javascript here. What I have is a store with images (There will be a smaller image of each item, and a larger image of each item, but I want...
2
by: henpat | last post by:
Hello all I have a DGV and I need that an icon (image) apears depending the Status field. The status field is 0, 1 or 2 and I need to put three different little pictures on it. Thanks for your...
2
by: Poppa Pimp | last post by:
ImageResizer.php Image Resizer PLEASE HELP The URL of the page this is on in my site is http://poppa-pimps-wallpapers.com//ImageResizer.php You can click on browse and get image,but...
9
by: Eric | last post by:
Hi Everyone, I'm writing a UserControl that exposes a property of the type System.Drawing.Image, like this: Public Property DefaultImage() As Image Get Return propDefaultImage End Get...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.