How to add images in a DataGrid

  • Thread starter SamuelSudhakarJ
  • Start date
S

SamuelSudhakarJ

Hi Friends,
I have a database having all the country names and some geogrphical details
of the countries. I am displaying it in a DataGrid. I want to add Flag of
each and every country.
My customer is breaking my head.
Can anyone guide me?
Please!!!
 
J

John Paul. A

Dear SamuelSudhakarJ,
1> You need to derive a custom column style, override its Paint method and
draw the image.
2> Make One style as a stand-alone unbound column that just displays an
image.
3> Make Another custom column style that adds the image to the left side of
a bound column.
4> So, the actual image that is to be displayed is from an imagelist passed
into the column in its constructor. (The index of the image to be drawn on a
particular row is determined by a delegate passed into the column style
through its constructor. )

In this way, you can achieve your result.

Thanks & Regards,
John Paul. A
MCP
 
S

SamuelSudhakarJ

Thank You..
I got it..

John Paul. A said:
Dear SamuelSudhakarJ,
1> You need to derive a custom column style, override its Paint method and
draw the image.
2> Make One style as a stand-alone unbound column that just displays an
image.
3> Make Another custom column style that adds the image to the left side of
a bound column.
4> So, the actual image that is to be displayed is from an imagelist passed
into the column in its constructor. (The index of the image to be drawn on a
particular row is determined by a delegate passed into the column style
through its constructor. )

In this way, you can achieve your result.

Thanks & Regards,
John Paul. A
MCP
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top