When you want to display other components in a TDBGrid (to emulate a TDBCtrlGrid), you have to "embed" them, following these principles, basically:
- when displaying, the dbGrid is drawn.
- when a cell is selected, it is necessary to embed a component in the cell and give it focus.
- when the component is left (tab, mouse key elsewhere, the component must be unlocked, the grid must have focus, and even redraw itself with the control data.
For overlay, several levels can be used for focus transfers between a cell and the overlay control:
- control incrustation when a cell has the focus, without giving the focus to the control.
- transfer from focus to control only for data entry.
Some general rules can therefore be identified:
- the display of the embedded control can be done in OnDrawDataCell, when dgFocused is part of the State parameter. Events like OnEnter can also be used for this purpose.
OnDrawDataCell is not normally designed for this: it is used to refresh the screen, i.e. to explain how to draw the TRec from the cell by the OS, but...
- unincrust, i. e. assign Visible:= False can be done in TControl.OnExit, and in dbGrid.OnColExit (but does not cover the case of a vertical movement in the same column).
- you must manage keyboard events when the control is embedded, visible. First, it is necessary to make the focus shift between the control and the dbGrid homogeneous: therefore, you can code the typing of the Tab and navigation arrows keys.
All this, to say that it's not simple (it's just to show the minimal logic, how to replace the inPlaceEditor with other controls). In my humble opinion, the most pragmatic thing is to look at the code of the component that have been notified by Zoran (see
https://forum.lazarus.freepascal.org/index.php/topic,47319.msg338673.html#msg338673), and adapt it so that it'll work with your database too.
Two cents.