Set Dynamic Panel state based on number of visible elements

solved it. No need for the panels.