From: Marc Sol? on
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 open folder).

When I accept, in the design form, appears in the ImageColumn the typical
red cross of an image not found.

Please, can anyone tell me what I'm doing wrong?

Thanks.


From: Kevin Spencer on
It's hard to say from your description. A DataGridViewImageColumn can
display either an image or an icon. The Image property is an instance of the
System.Drawing.Image class, which can be any class derived from
System.Drawing.Image (such as a Bitmap). The Image property is only used
when (1) The Value property of the cell is not set, (2) The column is not
data-bound, and (3) the ValueIsIcon property is false.

In your post, you said "I select the image (an icon of an open folder)".
This is confusing, as an icon is not an image. So, do you mean an image, or
an icon? And when you say "I select" what exactly do you mean? Do you mean
that you assign an Image to the Image property, or something else?

To use an icon in a DataGridViewImageColumn, you must set the Icon property
of the column, and set ValueIsIcon to true. And again, with the Icon
property, the Value of the cell must not be set, and the column must not be
data-bound.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.

"Marc Sol?" <msole(a)emdep.com> wrote in message
news:OoGX9LKgGHA.1264(a)TK2MSFTNGP05.phx.gbl...
> 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 open folder).
>
> When I accept, in the design form, appears in the ImageColumn the typical
> red cross of an image not found.
>
> Please, can anyone tell me what I'm doing wrong?
>
> Thanks.
>
>


From: Marc Sol? on
Kevin,
first of all, many thanks for answer my post.
Now I will try to explain you what I want to do exactly.
The thing I want to do is to put an icon in a cell of a dataGridView.
I'm going to explaint better. I have a dataGridView where the user can edit
the columns number 1 to 10, and in column 11 I want to put the MS Windows
open folder icon, that is associated to an event when the user click there.
Now it works without the icon, and I want to put the icon there.
You understand?
I have seen that the dataGridView allows to change the type of a column, so
I have changed, in the design window, the type of column 11 to
dataGridViewImageColumn, and I have assigned an image, an icon, etc, and
anyone works.

The only thing that I want is to put an icon in the cell. Is there any
"easy" way to do that?

Thanks a lot!



"Kevin Spencer" <kevin(a)DIESPAMMERSDIEtakempis.com> wrote in message
news:%23E2BwUNgGHA.4172(a)TK2MSFTNGP04.phx.gbl...
> It's hard to say from your description. A DataGridViewImageColumn can
> display either an image or an icon. The Image property is an instance of
the
> System.Drawing.Image class, which can be any class derived from
> System.Drawing.Image (such as a Bitmap). The Image property is only used
> when (1) The Value property of the cell is not set, (2) The column is not
> data-bound, and (3) the ValueIsIcon property is false.
>
> In your post, you said "I select the image (an icon of an open folder)".
> This is confusing, as an icon is not an image. So, do you mean an image,
or
> an icon? And when you say "I select" what exactly do you mean? Do you mean
> that you assign an Image to the Image property, or something else?
>
> To use an icon in a DataGridViewImageColumn, you must set the Icon
property
> of the column, and set ValueIsIcon to true. And again, with the Icon
> property, the Value of the cell must not be set, and the column must not
be
> data-bound.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Professional Numbskull
>
> This is, by definition, not that.
>
> "Marc Sol?" <msole(a)emdep.com> wrote in message
> news:OoGX9LKgGHA.1264(a)TK2MSFTNGP05.phx.gbl...
> > 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 open folder).
> >
> > When I accept, in the design form, appears in the ImageColumn the
typical
> > red cross of an image not found.
> >
> > Please, can anyone tell me what I'm doing wrong?
> >
> > Thanks.
> >
> >
>
>