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

How to achieve no wrap or auto fit property in grid.

1 Answer 1095 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mukesh
Top achievements
Rank 1
Mukesh asked on 05 Aug 2019, 10:32 AM

     Is there any way that i can achieve nowrap or auto fit for my text in columns. By default i have not defined any width for my columns, if my text is big it is wraping in next line, i don't want warping of the text. Is there any way to do that.

 

regards,

Mukesh 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 07 Aug 2019, 06:32 AM
Hello, Mukesh,

The no wrap can be achieved using CSS as shown in the following forum post:

https://www.telerik.com/forums/no-text-warping-inside-kendo-react-grid-column-for-extra-text-i-want-to-display-three-dot-(-)

As for the auto width I can suggest using a method to calculate with width of the rendered text(I used a third-party library called calculate size). Then set the width of the column to a function which will calculate the width of the longest text and set it. I made an example showcasing this:

https://stackblitz.com/edit/react-2jlahu?file=app/main.jsx

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mukesh
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or