Again I’m struggling with the grid control, I already posted that most of my trials to style a grid with CSS are ignored.
I have a concrete wish:
Simply to change the header back color.
By chance after setting a padding > 0px; I discovered that the backcolor of the Entire Header is set
but hidden behind the non transparent Header Cell so nothing is visible.
Now I tried the following: To set the back Color of each HeaderCell 1:1
Unfortunatly this time it doesn’t work because g.getHeaderRow(0).getCell(“0”); is null although in Debug mode
two cell having the key “0”, “1” are available, whats wrong here ???
[size=2]
List items = new ArrayList<>();
Buchung b = new Buchung();
b.setId(17);
b.setComment("1");
items.add(b);
b = new Buchung();
b.setComment("2");
b.setId(18);
items.add(b);
Grid<Buchung> g = new Grid<>();
g.setItems(items);
g.addColumn(Buchung::getId).setCaption("BuchungsId");
g.addColumn(Buchung::getComment).setCaption("Buchungskommentar");
>> IDE watch show two header cells
HeaderRow header = g.getHeaderRow(0);
HeaderCell c1 = g.getHeaderRow(0).getCell("0"); > null exception
HeaderCell c2 = g.getHeaderRow(0).getCell("1");
c1.setStyleName("myGrid");
c2.setStyleName("myGrid");
[/size]