Vaadin 8.1.0 Grid hide scroll bar and column hiding button

Hi ,

I am using Vaadin 8.1.0
And i am trying to hide the scroll bar and column hide button which shows at right side of grid.
This is becaus as i am using My custome Pagination for Grid.
How can hide them .
here i am attaching the screen shot of my grid showing portion to be hiden.

Regards
Nagaraj RC

34506.png

Hi,

The columns hide button can be removed by making the columns not hideable in Java or by setting the .v-grid-sidebar-button element to display:none with CSS.

I’m not 100% certain, but getting rid of the scroll bar seems more difficult. The vertical scrollbar element can be targeted with the CSS classname .v-grid-scroller-vertical and you can set it to display:none, but the size of the rest of the Grid needs to be compensated to fill that left over space. The width of the .v-grid-tablewrapper element needs to be a bit larger and that’s easy to change in e.g. Chrome dev tools manually, but if you want to change it dynamically when the window size changes (if your grid is not fixed width), you might need to adjust that on the client side.

-Olli

My grid is showing the scrollbar even when there is no necessity for that. It happens when I initialize a grid with no rows but then I load the data on it. Have someone experienced this situation?

I’ve discovered a way to remove the horizontal scrollbar in this case: I called the Grid method recalculateColumnWidths() after putting the new items on the grid:

grid.setItems(list);
grid.recalculateColumnWidths();