Wrap Text in Html.Kendo().Grid column

1 Answer 691 Views
Grid
Abhijeet
Top achievements
Rank 1
Abhijeet asked on 11 Oct 2023, 07:52 PM

I have a Html.Kendo().Grid  ASP.Net core 7.0 project. The grid displays several columns, some of them have big text. I want the text to not wrap. The text should show '...' in the end if the text is longer than the grid column. 

I have added 

 .k-grid td {       
     white-space: nowrap;        
 }

but still the text wraps as shown in the attached image.

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 16 Oct 2023, 10:09 AM

Hello Abhijeet,

You could display the column title text to end with ellipsis ('…') by adding the following CSS style:

<style>
  #grid .k-grid-header .k-column-title {
    text-overflow: ellipsis;
  }
</style>

In case the column title does not render as expected, please share any Grid-related custom CSS styles and the used Kendo UI theme, so I can review them and share a better suggestion.

 

Regards,
Mihaela
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Grid
Asked by
Abhijeet
Top achievements
Rank 1
Answers by
Mihaela
Telerik team
Share this question
or