Vaadin 14 Grid header row remove

I will try this things but it is not working . what is the wrong in it?

:host([hide-header-row]) {
thead :nth-child(1)[part=‘row’], thead :nth-child(2)[part=‘row’] {
display: none;
}
}

public void setHeaderRowVisible(boolean visible) {
grid.getElement().setAttribute(“hide-header-row”, !visible);
}

How do you create the Grid? If you don’t set a header on the columns there will be no header

ok sir…

Unless you are using Sass to compile those styles, they are invalid CSS and won’t do anything. Nested selectors are not valid CSS.

Here’s the same thing in standard CSS:

:host([hide-header-row]) thead :nth-child(1)[part='row'], 
:host([hide-header-row]) thead :nth-child(2)[part='row'] {
    display: none;
}

Note, that those selectors are bit problematic, as they are not part of the public API (thead and :nth-child()), so those are not guaranteed to work in future releases.