I am working on the grid component in vaadin 8. In My grid, each column data fetched from the database and it may be too lengthy. the grid row height is not expanding based on the content in each column. My grid is given below.
You can see complete content is not visible in each columns.
In Vaadin8 the Grid component rows are not auto-adjusting, i.e. this feature does not exists there. The Grid rows are of fixed height. There is an API to configure the row height e.g. grid.setRowHeight(50).
This limitation no longer exists in the newer generation Vaadin frameworks, e.g. Vaadin 14.
Related
in my Grid a have a cell with long text .
Automatically Grid makes width:auto and I get very wide cells.
I want to make this cells more "readable" for user with
.dashboard .v-grid-cell{
word-wrap:all;
height:auto;
}
It takes no result ((
And I don't want to make all rows with same height, height or each row must be dependable of height of this cell.
You hope my question is clean ))
Grid in Vaadin 8 and Vaadin 7 does not support rows being of variable heights. So unfortunately answer is no.
In latest versions of Vaadin Platform 10 and newer there is totally new implementation of Grid, which however supports variable row heights.
I'm creating a vaadin grid with three columns of which one column is having HTML contents. HTML data can be in multiple lines. By default only first line of HTML Data is getting displayed in the Grid.
Below is my code
Grid grid = new Grid();
grid.setColumns("C1","C2","C3");
grid.getColumn("C1").setHeaderCaption("Column 1");
grid.getColumn("C2").setHeaderCaption("Column 2");
grid.getColumn("C3").setHeaderCaption("Column 3");
grid.getColumn("C2").setRenderer(new HtmlRenderer());
grid.addRow("text1","<p>Line 1 Data</p><p>Line 2 Data</p>","data1");
grid.addRow("text2","<table><tr><th>Month</th><th>Savings</th></tr><tr><td>January</td><td>$100</td></tr></table>","data2");
And the grid looks like this
How to set the height of rows dynamically based on height of the HTML Data?
I'm using vaadin 7
How to set the height of rows dynamically based on height of the HTML Data?
This feature is not supported in Vaadin 7 or Vaadin 8 Grid. The Grid is based on fixed height rows. In Vaadin 7 you can set the Grid height in your theme (see more info here: https://vaadin.com/forum/thread/14385724), in Vaadin 8.1+ there is also setRowHeight() method in Grid.
I am trying to make my take up all vertical space even if there are no rows in the table yet. Is clr-datagrid customizable to do so? It seems like I have to manually override flexbox properties of .datagrid-host and .datagrid-overlay-wrapper in order to make it grow in column direction.
I tried even that but the datagrid don't seem to be growing vertically.
The Clarity datagrid supports any fixed height you want on the datagrid element itself. If the height is too large for the number of displayed rows, the body will expand with empty space. If the height is too small for the number of displayed rows, the body will scroll while the header and footer remain in place.
So in your case, it's as simple as putting height: 100% for the datagrid in your CSS. That's all you need to do. See https://plnkr.co/edit/eZqaic8CS6CFHVcGxAnH?p=preview for a working example.
How do i create a table of unknown number of rows and columns in my UITableViewCell ? I am creating a survey application and the reporting can contain matrix type questions aswell. How do i view those in my TableViewCell. if the number of rows and columns exceed, it should also use scrolling to display the content. below is the picture of how it looks like. also this app is for iPhone and iPad both so the answer should be kept in consideration of Auto Layouts.
EDIT
The red crosses should also be in my control as i need to display a tick where the user has ticked.
I inserted a UIScrollView in the TableView's Cell and created the rows and columns dynamically using for loops on the basis of the number of rows and columns. Created dynamic labels for columns and rows and imageViews for tick and crosses and kept on managing the size by using x and y and at the end set the scrollView's content according to x and y for the scrolling.
I've created a table from a TcxGrid with a simple table view. The data is being poked into the table using DataController.Values[n,m] as a simple string and I have some 10 columns that will show various string widths.
The problem that I'm having is getting a table that has a horizontal scroll bar AND has auto-sized its columns. If I set CellAutoWidth true this fits all columns into the display width (with no scroll bar) but if I set it false, I get a scroll bar but columns of my default width and my data strings are truncated.
Could some kind person tell me how to get a horizontal scroll bar AND get each column to adjust its width to fit its max data width please?
Thanks
Brian.
Maybe it's enough to call YourGridView.ApplyBestFit instead of using CellAutoWidth.
You need to set columns BestFitMaxWidth and MinWidth property and make sure you have the width of the Datasets TField also set (if you are using DataSets).
Then, you can call YourGridView.ApplyBestFit;