So in which event do you advise me to move the definition of the title height?
there are two places that can work
1) whenever you change a filter setting (as filters are the reason for the height to be different). If filter change, you'd need to review if the height needs to be any different than default height.
2) in the very most beginning of the paint. Before you pass the paint to TDBGrid, you need to adjust heights according to the current filter settings.
Approach #1 is better, than approach #2. Both of them would be doing the same thing (checking if height needs to be different).
But approach #1 would only do it when the height can actually change.
Approach #2 would do it every time the control paints. And that is a little of overhead.