moved grid-header directive function into Grid