in an interactive grid i have data for max 10 years (jaar in dutch); some years may not be present en should therefor not been shown in the interactive grid; In the main view I've used page_items for this purpose; P2510_JAAR1 .. P2510_JAAR10; if it's value null then the corresponding columns are being hide;
On this grid i've made an detail-view; and tried to hide the data of missing years by use of TEMPLATE DIRECTIVES;
i first tried template directives with the page items, in both the "Before Rows" and "For Each Row" in the form of:
{if ?P2510_JAAR1/}
<th>&P2510_JAAR1.</th>
{endif/}
this didn't work; now all years where gone

then i adjusted the query so i had the items in the query as well as JAAR1_AANWEZIG .. JAAR10_AANWEZIG
this worked for the "For Each Row" section but not for the "Before Rows" section which is understandable
So my question is:
How to use the Template directives in the "Before Rows" section so it is working?
For now i have only applied the template directives in the "For Each Row" section and than the details view looks like this:

Thanks in advance
Regards Mark