0
votes

I want to override the background color of the TreeGrid object (and other default styles). But it doesn't let me change the default css.

TreeGrid grid = new TreeGrid();
grid.removeStyleName("listGrid");

OR

TreeGrid grid = new TreeGrid();
grid.removeStyleName(grid.getStyleName());

This code doesnt seem to work. The stylename remains the same. I think I'm missing something but I cant seem to figure it out. Also if I set another stylename for the widget it keeps the default stylename.

Thanks in advance!

1

1 Answers

0
votes

I found the answer myself.

Looks like there are various solutions. But this one was the easiest for me.

There are different methods for setting different parts of the style for this component. To set the body style name I simply used the following code and it worked. No need to create a new css rule here.

treeGrid.setBodyStyleName("#E0E0E0");