Datagrid and Icon

M

Miro

I have a table "phonenumbers" and to simplify this example... it has 2
columns.

PhoneType -Int
Phone - Char

In the phonetype i store a 0,1,2
0 = phone
1 = cell
2 = fax

on my form i have added an imagelist with 3 icons that corrispond to the
0,1,2

How can I get the datagrid view to show the Icon in the column vs the actual
number.

Im having trouble finding an example of this on the net.

Or - is there a better way of doing this?

Thanx,

Miro
 
M

Miro

I see,

I have the dataset filled/columns added already with the designer, so I add
a column to the datagrid through code or through the designer, and manually
add the picture to each element depending on the value looping through each
datarow first.

I was trying to figure out a way to map the column with the properties and
linking the two together / looking for a spot to add code that way.

I think this will get me on the right track.

Thanks,

Miro
 
M

Miro

Actually - is there a way to add an expression to the datagrid column?

So I should be able to add the column through the visual editor, and then
use an event of the datagrid to display the imagelist.image( value of
column ) picture in it.

The question is which event to use.

I have some 'reading to do'...

Thanks

Miro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top