I am designing my own Delphi XE5 custom grid. I'm not interested in VCL, so I am working with FireMonkey only. Since it will have to be data-aware, LiveBindings is a must. The task is complex, so I will try to ask just for very specific problems.
A foreword. I am finding FireMonkey (just like the old VCL) a bit difficult to extend. It does use interfaces extensively, but there is still a lot of code that is not overrideable or that references private members. I find myself having to copy entire classes just to change 5-10 lines of behaviour.
What I have now is (ME.Grid):
TCustomGrid -> TMECustomGrid -> TMEGrid (my custom grid)
TColumn -> TMEColumn -> TMExxxColumn (specific custom column classes)
Txxx -> TMExxxCell (specific custom grid cell classes)
All registered with RegisterFmxClasses. TMEGrid is also registered with RegisterComponents.
I also have (ME.Bind.Grid):
TMELinkGridColumnDescription = Class(TLinkGridColumnDescription)
TMELinkGridToDataSourceControlManager = Class(TInterfacedObject,
ILinkGridToDataSourceControlManager)
TMELinkGridToDataSourceColumnFactory = Class(TLinkGridToDataSourceColumnFactory)
... the latter is registered with RegisterLinkGridToDataSourceColumnFactory
All this with a minimal implementation. I'll add/change behaviour afterwards. My goal now is to drop a TMEGrid on the form, drop some dataset and have the bindings do something with my grid.
What I get (when the application fires up) is EBindCompError 'No list control editor available'.
Since this worked when I had derived TMEGrid from TGrid (which was unacceptable for other reasons), I checked around and I noticed that Bind.Editors references TGrid explicitly (instead of TCustomGrid). So I wrote my own (ME.Bind.Editors):
TMEBindListGridEditor = Class(TBindListEditorCommon,
IBindListVirtualEditor,
IBindGridEditor,
IBindListVirtualEditorScope)
TMEBindGridEditorFactory = Class(TBindEditorFactory)
... the latter is registered with RegisterBindEditorFactory
But this did not seem to change anything. I still get the same error message.
Any ideas?
Keep in mind that all the components, factories, etc... are in their own package (MEComps). The project just has the one form with a grid and some other stuff (a navigator, some buttons).
Edit: I think I have found a clue. I checked my source from within the test project and I found that the
RegisterBindEditorFactory([TMEBindGridEditorFactory]);
code line is not compiled into the project (I can't put a break point there). Obviously it is not being pulled into the project, which is certainly not a good sign. So I checked where the counterpart unit is being used (FMX.Bind.Editors) and I found this very interesting BindCompFMXReg unit, of which I have no equivalent. I'll study this to see if I can get somewhere.