TDBCtrlGrid controls.

How can I hide/show certain controls in a TDBCtrlGrid depending on
the values of certain fields? I've put some code inside OnPaintPanel
event but it behaves rather strangely.
Thanks very much.