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

How add a custom class for header text

1 Answer 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SturmA
Top achievements
Rank 2
SturmA asked on 21 Sep 2020, 10:59 AM

 

I want to rotate the header text to 90 degree.

<style>
    .rotate-text {
        float: left;
        line-height: 0.7;
        -ms-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
        margin: 0;
        padding: 0;
    }
</style>
columns.Bound(c => c.Number).ClientHeaderTemplate("<div class='' >#=???#</div>");

 

How can i access the original header text inside of the template ?

 

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 23 Sep 2020, 02:16 PM

Hello, Arthur

Thank you for providing a code snippet.

If I may suggest a slight touch-up, we could use HeaderHtmlAttributes instead of ClientHeaderTemplate.

Then we can directly apply the class to the particular column header.

columns.Bound(c => c.Number).HeaderHtmlAttributes(new { @class = "rotate-text" });

If this suggestion does not resolve your problem, please let me know.

 

Regards,
Georgi Denchev
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
SturmA
Top achievements
Rank 2
Answers by
Georgi Denchev
Telerik team
Share this question
or