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

Grid Column Title Multiple Lines Of Text

1 Answer 1955 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
Veteran
George asked on 04 Nov 2020, 11:11 PM

I want to display multiple lines in the grid Title.  I've tried <br /> and \n.  They show up as literal characters.  I've modified the css for grid header height to be set to auto and the long text wraps but not where I want it to wrap.  Here is an example:

This is what I want it to look like:
Labor & Burden
Cost Type 1234

Here is how it shows up:
Labor & Burden Cost
Type 1234

How do I force the wrapping of the text where I want it?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 05 Nov 2020, 07:23 AM

Hello George,

Blazor encodes HTML from strings when rendering, and that applies to our components too. This is why you can't use HTML in such literals.

What you can do is to use the HeaderTemplate of the column which lets you define your content as desired: https://docs.telerik.com/blazor-ui/components/grid/templates/column-header

 

Regards,
Marin Bratanov
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/.

Tags
Grid
Asked by
George
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or