Grid width

Hi Guys,
I have go a question.
When I have Table and its content does not fill more than the width of the browser area it is nicely displayed (all columns are visible and the columns fits the cells nicely). If I use the Grid component only the first few columns are dislyaped and a scrollbar appears however there is enough space for the hidden columns. Any tip idea ?
Thank you

Are your Grid and any wrapping layouts 100% wide?

Thanks Thomas for responding.
As you can see in the attachment the grid is wrapped in two TabSheet and a Verticallayout inside a TabSheet. I added a Table with the same Container and it lokks very nice, fits the cell and the width is Ok. I have not set any size settings for the Table as well as the Grid.

28210.png

OK, I see. The Grid has different behaviour for the default width than Table; unfortunately it seems that the old one is better, at least in this case. I’m afraid you will have to set the width for the Grid yourself. If you think this is a serious issue, you can also report is as a bug in our ticketing system:
http://dev.vaadin.com

Thank you I will do that but it is not so important for me now. It shuold be just a nice feature.

I have a similar issue, the grid displays only few columns with a horizontal scroll even though there is space for the remaining columns. How do I get the grid to show all the columns.

If you want to set width of the Grid to match the total width of the columns (+16 px for the vertical scroll bar), you need the actual witdths of the columns, and actually Grid does not have builtin method for that. Thus I added getColumnWidth(…) method to GridScrollExtension add-on and added use of it in demo application.


https://vaadin.com/directory/component/gridscrollextension-add-on

Demo using the add-on is in here:
https://github.com/TatuLund/grid-scroll-extension/blob/vaadin8/GridScrollExtension-demo/src/main/java/org/vaadin/extension/demo/DemoUI.java