A descendant of TStyledPresentationProxy has not been registered for class

  

I have a custom grid control that inherits from TGrid called TFmGrid. This control was working fine in Rad Studio 10 Seattle Update One. I recently upgraded to 10.1 Berlin and started noticing this error message showing up on my TFmGrid controls both when I run the application and in the designer:

A descendant of TStyledPresentationProxy has not been registered for class TFmGrid. Maybe it is necessary to add the FMX.Grid.Style module to the uses section

The image below shows how the error message shows up on my grid controls:

I started by doing as the message suggests, and adding #include <FMX.Grid.Style.hpp> to the header file of my TFmGrid control, however this seems to have done nothing.

So as far as trying to register a decendant of TStyledPresentationProxy I am not exactly sure where to start. I found this documentation about a method which:

Attempts to register the presentation proxy class with the specified name or the specified combination of control class and control type.

So I assume I need to use this method or at least something similar, but I don’t understand how I am supposed to go about calling this method.

But then that brings up the question of WHERE do I call this code?

My custom control has a method in its namespace called Register() which I believe was autogenerated by the IDE when the control was created:

namespace Fmgridu
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TFmGrid)};
RegisterComponents(L”Kalos FM Controls”, classes, 0);
}
}

Do I need to call something in there to register a decendant of TStyledPresentationProxy? What is the proper way to go about this?

Comments are closed.