Nested Grid - Hide field / block when no record found

Hello,

May I know if anyone can help to achieve the following result?

Scenario:
I have a grid application (customer) and nested grid (order) that I can view what customer orders in customer grid itself. However, it is very messy to see the “order” grid’s title/label bar (order_id, items, quantity, date, etc) when there is “no records found” for a particular customer. May I know how do we hide the title/label bar when there is no record found for a particular customer? I tried the following codes but it won’t work, can anyone point the mistake?

Event: onapplicationinit
if (empty({id}))
{
sc_block_display(grid_order_1, off);
}

Tried to hide particular field also won’t work:
Event: onapplicationinit
if (empty({id}))
{
sc_field_display(order_date, off);
}

Thanks