GWT - Datagrid Selection Color

358 views
Skip to first unread message

Marco

unread,
Mar 5, 2012, 1:35:41 PM3/5/12
to Google Web Toolkit
Hi,
is there a way to change global the selection color of gwt datagrid? I
added following css-format in the main-app-css file:

.dataGridSelectedRow {
background: #1EDA17;
color: white;
height: auto;
overflow: auto;
}

I have seen also following link:
http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideUiCss.html

Sadly my change had no effect. Do I miss any setStyleName() call?

Jens

unread,
Mar 5, 2012, 4:10:39 PM3/5/12
to google-we...@googlegroups.com
DataGrid uses a ClientBundle/CssResource for its images/css so you have to extend it and provide your custom css by overwriting dataGridStyle() and provide your own css file using @Source annotation.

Something like:

interface MyDataGridResources extends DataGrid.Resources {

  @Override
  @Source({DataGrid.Style.DEFAUL_CSS, "yourCustomStyle.css"})
  DataGrid.Style dataGridStyle();

}

By merging the DataGrid default css with your custom css you don't have to provide all css classes in your own file and can selectively overwrite the defaults.


-- J.
Reply all
Reply to author
Forward
0 new messages