Multiline one column row in a vaadin 8 grid

Is it possible to display a column where text is wrapped?

I tried doing it by new HtmlRenderer() in a column. Like in the example https://vaadin.com/docs/-/part/framework/components/components-grid.html

It doesnt work. Im passing a html string but it just cut text after
not displaying it at all :frowning:
It shows:
Lorem ipsum dolor sit amet, consetetur
My String is:
Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam
nonumy eirmod tempor invidunt
ut labore et dolore magna
aliquyam erat, sed diam voluptua.
At vero eos et accusam et
justo duo dolores et ea rebum.
Stet clita kasd gubergren,
no sea takimata sanctus est
Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet,
consetetur sadipscing elitr,
sed diam nonumy eirmod tempor
invidunt ut labore et dolore
magna aliquyam erat, sed diam
voluptua. At vero eos et accusam
et justo duo dolores et ea
rebum. Stet clita kasd gubergren,
no sea takimata sanctus est
Lorem ipsum dolor sit amet.

    @PostConstruct
    private void init() {


        description = addColumn(description -> changeStringToPassRow(description.getDescription()), new HtmlRenderer())
                .setCaption(i18n.getWithDefault("eventsOverviewComponent.description", "Beschreibung"))
                .setExpandRatio(1);


    }

Grid rows currently have to have the same height, so it’s not possible to have a Grid with varying width components.

thank you for your answer. I could define hight by css.
Is it possible to define row height dynamically depends on string in my rows?

    @PostConstruct
    private void init() {
        addStyleName("eventsGrid");
        description = addColumn(description -> changeStringToPassRow(description.getDescription()), new HtmlRenderer())
                .setCaption(i18n.getWithDefault("eventsOverviewComponent.description", "Beschreibung"))
                .setExpandRatio(1);
        styles.add(".eventsGrid td { height: 100px !important;}");

    }

You can define height by CSS, but this will break a lot of redrawing logic within the grid because it relies on rows having equal height. If you want a component that renders elements with varied height, I’d suggest using
GridLayout
instead.

Piotr, but my question is how to define a row depends on longest string value (I will ask in Polish so maybe you could understand me better :wink: Potrzebuje, zeby wysokosc wiersza “Beschreibung” byla zalezna od dlugosci tekstu w komorce. np. wartosc najdluzszego pola wiersza definiuje wysokosc wiersza dla kazdej pozycji. Dziwne, ze grid wcale tego nie wspiera.

Better stick to English on public forums :slight_smile: I understand what you’re trying to accomplish, but (as you noted)
Grid
does not support it (because of how it’s implemented).