3
votes

I have a TGrid on a form. I need to display a TImage inside that grid, as it´s background. I know that in Firemonkey framework, controls are containers to other controls. Having that in mind, I dragged the TImage Object to the TGrid Obect using the structure pannel. Now the TImage´s parent is the TGrid object. In design time, it´s fine, I can see the TImage "inside" the TGrid, but when I run the application, the TImage is gone.

Have spent all weekend googling for an answer and despite finding a lot of vcl oriented solutions, and all of them trying to put a TImage inside a TDBGrid or TStringGrid column, I couldn´t find anything that can help me.

Am I using the correct approach?

How can I accomplish my goal?

To test, is very simple:

Just drag a TGrid to a FMX form. Crate a couple of columns inside it. Drag a TImage to the form. Now in the scruture panel, find the TImage Obect and drag it to make it child of the TGrid component. Assign a Bitmap to it, and send it to back.

You will see the image as a background of the grid, but when you run the application, the image disapears.

Thanks.

1
You could try to place the TGrid inside the TImage instead. Then TGrid has no control of the image and just shows itself on top of it (if you align to client).Hans
Wow! That worked! Thank you Hans!Leonardo

1 Answers

1
votes

As suggested by Hans, I´ve inverted the parent/child relationship, making the image, parent of the grid.

After tunning a litte bit with the Opacity properties of both obects, I managed to get the result I needed.

Thank you Hans!