--- /dev/null
+package com.vaadin.tests.components.grid;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+public class InitiallyDisabledGrid extends UI {
+
+ public static class NotAPersonJustStringAndInt {
+ private String name;
+
+ public NotAPersonJustStringAndInt() {
+ }
+
+ public NotAPersonJustStringAndInt(String string, int i) {
+ name = string;
+ age = i;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ private int age;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ }
+
+ @Override
+ protected void init(VaadinRequest request) {
+ VerticalLayout layout = new VerticalLayout();
+ setContent(layout);
+ layout.setSizeFull();
+ layout.setWidth("600px");
+ layout.setHeight("600px");
+ final Grid g = createGrid();
+ Button button = new Button("Sample button");
+
+ layout.addComponent(button);
+ VerticalLayout l = new VerticalLayout();
+ l.setSizeFull();
+ l.addComponent(g);
+
+ layout.addComponent(l);
+ layout.setExpandRatio(l, 1.0f);
+ }
+
+ private Grid createGrid() {
+ // Have some data
+ Collection<NotAPersonJustStringAndInt> people = new ArrayList<NotAPersonJustStringAndInt>();
+ for (int i = 0; i < 100; i++) {
+ people.add(new NotAPersonJustStringAndInt("A " + i, i));
+ }
+ // Have a container of some type to contain the data
+ BeanItemContainer<NotAPersonJustStringAndInt> container = new BeanItemContainer<NotAPersonJustStringAndInt>(
+ NotAPersonJustStringAndInt.class, people);
+
+ // Create a grid bound to the container
+ Grid grid = new Grid(container);
+ grid.setSizeFull();
+ grid.setColumnOrder("name", "age");
+
+ grid.setEnabled(false);
+
+ return grid;
+
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package com.vaadin.tests.components.grid;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridCellElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class InitiallyDisabledGridTest extends SingleBrowserTest {
+
+ @Test
+ public void columnsExpanded() {
+ openTestURL();
+
+ GridElement grid = $(GridElement.class).first();
+ GridCellElement col0 = grid.getCell(0, 0);
+ GridCellElement col1 = grid.getCell(0, 1);
+ Assert.assertTrue(col0.getSize().getWidth() > 250);
+ Assert.assertTrue(col1.getSize().getWidth() > 250);
+ }
+}