How to customize a GWT DataGrid style

I had to deal with GWT DataGrid and his style customization. In order to customize it you have to extend the DataGrid style resource with your own type. Then you have to override the dataGridStyle() method returning your own DataGrid style. It is fundamental to return a new DataGrid Style type.

Here the example code:

As alternative you can simply extends the default one:

Sources:

 

 

2 thoughts on “How to customize a GWT DataGrid style

  1. “DataGrid.Resources” could not be resolved in my Eclipse…

    Your source reference to the google code link has a different syntax:

    “CellTable.Resources”

    What is correct?

  2. Have you tried to import it? It an interface declared inside the DataGrid class. Sometime Eclipse resolver has problems with classes/interfaces declared inside other classes. Try to import it manually.

    If you are using a DataGrid you should use the DataGrid.Resources interface.
    The referenced issue is about the CellTable widget, but the targeted the comment explain the problem that affect also the DataGrid.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.