Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 492
  • Last Modified:

How to Save/Get images from DataGridViewImageColumn

I have a simple datagridview with 3 columns.
column1 is a DataGridViewImageColumn
column2 is a TextBoxColumn
column3 is a TextBoxColumn

I'm trying to save all the cells with the code below.
The problem is that I don't understand how I could save/get the images from the imagecolumn ?
Any easy suggestions ?
foreach (DataGridViewRow xx in dataGridView1.Rows)
            {
 
                string col2 = xx.Cells["Column2"].Value.ToString();
                string col3 = xx.Cells["Column3"].Value.ToString();
            }

Open in new window

0
Smyken
Asked:
Smyken
1 Solution
 
chrisbrayCommented:
I am not able to test this at the moment, but you should be able to simply go:

Image image = (Image)xx.Cells["Column2"].Value;

Chris Bray


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now