Remove Grid header

Hello,

I am trying to create a sortable list. I am using a grid with only one column for that. So far so good. But how can I remove or make the header invisible?

Thanks,
Daniel

As long as you create the grid using automatic column creation based on the class (new Grid<MyClass>(MyClass.class);), it will always create a header. [Currently, you are not able to remove a column header once it is there]
(https://github.com/vaadin/vaadin-grid-flow/issues/480#issuecomment-524751893).

When you create the Grid like this: new Grid<MyClass>(); then it will not create any column automatically for you. Since in your case you only want one column, this should be easy to add yourself. While adding that column, just avoid adding a header for that column and there won’t be one.

Don’t use the addColumn overload that accepts a String (propertyName), as that will also create a header for you. Instead, use an addColumn overload that accepts a ValueProvider or a componentRenderer, as these methods will not create a header.

Edit: Usually when a grid column is sortable, the sorting indicator/toggler is displayed in the header. Where would the user click in your case to apply a sorting? Or does he not have that option and the grid is initially sorted the way you want it to be sorted?

Thanks Kaspar, it works like a charm now.

And to answer your sort question, there is no need or possibility for sorting. Because I want to be able to reorder the items via drag and drop.

Hello!

Is it planned to make header rows removeable? I will need this feature.

As an alternative a button to manual hide them would be nice.

Many thanks from Germany
Thomas

Did you manage to find solution on this problem? There is no removeGridHeader till now.