TTMSFMXBitmapGridCell Error

Hi,
I am encountering an access violation while updating an image in a cell. Basically when a user clicks in the cell, it toggles a property that turns a green tick image on and off in the cell.

Using the grid's GetCellProperties I assign a cell's bitmap to a TImage object on the form like this:

if ShowCellTick then
   TTMSFMXBitmapGridCell(cell).Bitmap.LinkedImage := tickImage // show a green tick
else
   TTMSFMXBitmapGridCell(cell).Bitmap.LinkedImage := nil; // show a blank cell

But when the user clicks in the cell, 50% of the time I get an access violation, which I have tracked back to the TTMSFMXGridCell.GetTextRect: TRectF; method, yet the rest of the time it works fine.. Please note that the grid is unbound.

My question is: Is the LinkedImage property the correct way to assign an image to a cell or is there a better way?

Many thanks,
David

You can directly assign the bitmap:


TTMSFMXBitmapGridCell(cell).Bitmap.Bitmap.Assign(tickImage.Bitmap).

Do you return the correct class type in the OnGetCellClass event?

Kind Regards, 
Pieter