Someone suggested me to use 

myDataGrid.setMinimumTableWidth(600, Unit.PX);

That works but my table was created dynamically. Sometimes there are 5 
columns sometimes it can be 50 columns.

 can we make it dynamically? also 
can we calculate the width of column so that it will fit all data in that 
column?

For ex, if a column has a header "The Article Name" & a cell "This is 
article title of the book...." then the column should find the longest data 
& set the width accordingly so that the text  "This is article title of the 
book...." will be fit into the column.

Other ex, if the header is "ID" & cell is "1" then the column width should 
contain the whole word "ID" which is the longest data in the column.
 

On Friday, July 18, 2014 2:03:00 PM UTC+10, Tom wrote:
>
> I like DataGrid since it has fixed header so wen user scrolldown they are 
> still be able to see the column header. 
>
> However, if there are too many columns then the DataGrid will manage to 
> fit all columns within the Fixed Width of the widget that contain it. 
>
> For example, if a 30 column DataGrid was put inside a center (with 100px) 
> of a DockLayoutPanel then all 30 columns will be divided evenly within 
> 100px, which is make it unreadable cos the with of each column is too small.
>
> So, I would love to use DataGrid but the DataGrid should have a 
> Horizontal ScrollBar at the bottom so if there are many column then the 
> user can just scroll horizontally to the right to see the data. 
>
> If we do correctly, then it should be like the *GWT CellSampler example* 
> http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCellSampler
>
> Clearly, the CellSampler used DataGid, but I didn't see any Horizontal 
> ScrollBar code in there.
>
> So how to make DataGrid to display as in the CellSampler example?
>
>
> http://stackoverflow.com/questions/24817026/how-to-create-the-horizontal-scrollbar-at-the-bottom-of-datagrid-as-in-gwt-cells
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to