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

Native Grid AutoFitColumn

2 Answers 274 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 12 Apr 2019, 01:57 PM

I can't seem to find anything in the docs about how to make the columns auto-fit the width of the container. In the grid wrapper, I've found https://docs.telerik.com/kendo-ui/knowledge-base/grid-autofit-all-columns-width and can use the dataBound event to access the autoFitColumn method. However, I just can't find anything similar in the docs for the native grid.

Thanks for any help I can get!!

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 16 Apr 2019, 12:52 PM
Hi Ken,

Yes indeed there is not such built in functionality in Kendo Native Vue Grid so far. 

Basically in order to achieve such behavior we have to loop through all the rendered items and calculate the width of the column depending on the length of the text in the "longest" cell. I have created a sample stackblitz example where I have implemented such behavior with a dummy data and length formula for the width. Please review it and let me know if it is something close to what you are expecting or if your scenario is somehow different.

Regards,
Plamen
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
0
balazs
Top achievements
Rank 2
Iron
answered on 12 Dec 2024, 01:14 PM | edited on 12 Dec 2024, 01:16 PM

The biggest issue is, how they have all the setup in the native, you can't even use table auto-layout and width 100% neither...

We're looking for a new tool and seems TELERIK won't be our choice for VUEJS.

1. no way to set up columns in the template (not to mention nested columns)

2. no way to auto adjust columns to content

3. no way to utilize pure CSS to do the same

4. no way to use other units as px or %

 

Ohh and seems no answer from telerik for  the last 5 years...

Actually, I remember it took them so much to realize that they had an issue in reporting (after I did a ticket on that).

Interesting thing to know: the Angular components and their support there was awesome.

Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Plamen
Telerik team
balazs
Top achievements
Rank 2
Iron
Share this question
or