This is a migrated thread and some comments may be shown as answers.

Multiline columns

2 Answers 1879 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hans-Jürgen
Top achievements
Rank 1
Veteran
Hans-Jürgen asked on 06 Jan 2021, 03:07 PM

Hey,

I have a problem displaying texts that have multiple lines in my columns (text bound to a database and linebreaks are cr lf).

In the grid the texts are displayed in a single line.

My intuition would be to use a column template as I haven't found a way to configure columns to show multiple lines. But I don't know how this template would have to look like.

Could you help me with this?

2 Answers, 1 is accepted

Sort by
-1
Accepted
Anton Mironov
Telerik team
answered on 08 Jan 2021, 11:03 AM

Hi Hans,

The default behavior for the Kendo UI Grid is to set multiple rows of text out of the box. Here is an example:

However, I can see what is your point. One of the possibilities is to use a Template. In order to achieve the desired behavior without using templates, I would recommend the approach demonstrated in the following article:

I hope this information helps.


Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 12 Apr 2023, 05:51 AM

Hello,

Is there an example with the template?

Anton Mironov
Telerik team
commented on 13 Apr 2023, 06:45 AM

Hi Dan,

Here is a dojo example of the described approach:

I hope this achieves the desired result.

Best Regards,
Anton Mironov

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 13 Apr 2023, 06:54 AM

Hi Anton,

I think you misunderstood me. You mentioned in the post "One of the possibilities is to use a Template". And I am asking if you have an example using a template.

The dojo is the same as the knowledge base.

Anton Mironov
Telerik team
commented on 13 Apr 2023, 07:06 AM

Hi Dan,

Here is an example of using a template:

Feel free to use it in the Grid as per the needs of your application.


Kind Regards,
Anton Mironov

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 13 Apr 2023, 07:11 AM

Hi Anton,

Again I did not need that. I know how to make a template. I needed how to make a template for a column where multiple lines are needed.

Anyway I manage to find a better solution with using just html attributes instead of using template or changing the server

0
Hans-Jürgen
Top achievements
Rank 1
Veteran
answered on 08 Jan 2021, 11:50 AM
Thank you, this solved my problem.
Tags
Grid
Asked by
Hans-Jürgen
Top achievements
Rank 1
Veteran
Answers by
Anton Mironov
Telerik team
Hans-Jürgen
Top achievements
Rank 1
Veteran
Share this question
or