Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Displaying Icons or Images in a Grid.
Wed, Sep 2 2015 3:03 AMPermanent Link

Steve Gill

Avatar

Has anyone worked out how to display an image or icon in a TGrid column/row?

I have tried setting the column type to ctImage and ctIcon, but I can't work out how to actually assign an icon or image.  I have scanned the help for answers but couldn't find anything in there.

= Steve
Wed, Sep 2 2015 3:11 AMPermanent Link

Steve Gill

Avatar

Well, I didn't think it would be so simple.

For icons you just specify the icon name in the row as text, eg.

grdTest.Rows[0][0] := 'OK';

And for images you add the URL as text, eg.

grdTest.Rows[0][0] := 'http://localhost/images/ok.png';

Here I was looking for some special method or property.  It was simpler than I thought. Smile

= Steve
Wed, Sep 2 2015 3:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< And for images you add the URL as text, eg. >>

Also, images work like links with respect to supporting a semicolon-delimited set of two values:  the first for the URL and the (optional) second for the image hint that is displayed during mouse-overs.  With links, it's the first for the URL, and the second for the link text.

Tim Young
Elevate Software
www.elevatesoft.com
Image